Data type (int, double, boolean, String ...)
String input = new java.util.Scanner (System.in) .nextLine ();
String comparison (X = "Thanks";)
X.equals("Thanks") == true;
switch(num) { case 1: System.out.println(1); break; case 2: System.out.println(2); break; default: System.out.println("Other"); }
break, continue.
int[] nums1 = new int[x];
int[] nums2 = new int[] {x, y, z};
int[] nums3 = {x, y, z};
Extended for statement
for(int i : nums) { System.out.println(i) }
*** Example ***
for(int i=0; i < scores.length; i++) { sum += score[k] } for(int k : scores) { sum += k; }
The scope is only inside the block surrounded by {}.
import package.Class;
import package.*;
Recommended Posts