6-5第10行輸出報錯,實在看不出來了
public class HelloWorld {
? ? public static void main(String[] args) {
// 定義一個長度為 3 的字符串數(shù)組,并賦值初始值
String[] hobbys = { "sports", "game", "movie" };
System.out.println("循環(huán)輸出數(shù)組中元素的值:");
// 使用循環(huán)遍歷數(shù)組中的元素
for(int i=0;i<hobbys.length;i++);{
? ?System.out.println(hobbys[i]);
}
}
}
2019-05-17
for(int i=0;i<hobbys.length;i++){
? ?System.out.println(hobbys[i]);
}
for后面不用加;