Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
prog2_01 [2016-08-31 19:56]
Daniel Viström
prog2_01 [2017-09-01 14:54]
127.0.0.1 external edit
Line 15: Line 15:
  
   public static void main(String[] args) {   public static void main(String[] args) {
-    Scanner read = new Scanner(System.in);+    Scanner read = new Scanner(System.in);   // System.in ska inte stängas
     String namn;                  // Variabeldeklaration     String namn;                  // Variabeldeklaration
     int tal = 0;                  // Initiering av variabel     int tal = 0;                  // Initiering av variabel
Line 29: Line 29:
     tal = read.nextInt();     tal = read.nextInt();
     System.out.println(kvadrat(tal));     System.out.println(kvadrat(tal));
-    read.close();                 // Stänger inläsningsström 
   }   }
 } }