English Version
java
java while(); {} ascii
java { }
java developer.sun.com.cn java - eclipse IDE java.sun.com - NETBEAN IDE
IDE IDE eclipse IDE jdk eclipse IDE NETBEAN IDE jdk NETBEAN IDE
IDE IDE file new project package 1 new package class java, 1 new class main()
while while while (loop-continuation-condition) { // Loop body Statement(s); } int count = 0; while (count < 100) { System.out.println("Welcome to Java!"); count++; }
do while do while do { // Loop body; Statement(s); } while (loop-continuation-condition);
for for for (initial-action; loop-continuation-condition; action-after-each-iteration){ // Loop body; Statement(s); } int i; for (i = 0; i < 100; i++) { System.out.println("Welcome to Java!"); }
dataType[] arrayRefVar; double[] myList; String[] args; boolean[] isPassed; int[] studentAges;
new dataType[arraySize]; dataType[] arrayRefVar = new dataType[arraySize]; double[] myList = new double[10];
arrayRefVar.length
myList[0]=1; myList[1]=1; myList[2]=1; myList[3]=1; myList[4]=1; …… for (int i = 0; i < myList.length; i++) { myList[i] = i; }
0 arrayRefVar.length-1 double total = 0; for (int i = 0; i < myList.length; i++) { total += myList[i]; }
double max = myList[0]; int indexOfMax = 0; for (int i = 1; i < myList.length; i++) { if (myList[i] > max) { max = myList[i]; indexOfMax = i; }