#java基础知识一
publicclassTest{ | |
// main函数 | |
publicstaticvoidmain(String[] args){ | |
String[] str = newString[3]; | |
str[0] = "First String"; | |
str[1] = "Second String"; | |
str[2] = "Third String"; | |
// for循环语法1 | |
for (Strings : str) | |
System.out.println(s); | |
// for循环语法2 | |
for (inti = 0; i < str.length; i++){ | |
// if语法 | |
if (i != 1) { | |
System.out.println(str[i]); | |
} | |
} | |
} |