6-5第10行輸出報(bào)錯(cuò),實(shí)在看不出來(lái)了
public class HelloWorld {
? ? public static void main(String[] args) {
// 定義一個(gè)長(zhǎng)度為 3 的字符串?dāng)?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后面不用加;