public class czzzz {
public static void main(String[] args) {
String[] cao= {"sports","game","movie"}
System.out.println("输出循环数组的值:");
for(int i=0;i<cao.length;i++) {
System.out.println(cao[i]);
}
}
}
public class HelloWorld {
public static void main(String[] args) {
String[] cao= {"sports","game","movie"};
System.out.println("输出循环数组的值:");
for(int i=0;i<cao.length;i++) {
System.out.println(cao[i]);
}
}
}
本编译器中的class默认为Hello world,如果从在线编译肯定是错误的,系统会认为czzzzz是一个错误的class名,另外,数组后边有分号
String[] cao= {"sports","game","movie"}后面应该是少了一个分号
;;;;;;;;;