Java 对于语句解决方案
我真的很困惑为什么for语句行有错误。这是我无法运行的教程中的代码,因为第3行有错误Java 对于语句解决方案,java,for-loop,Java,For Loop,我真的很困惑为什么for语句行有错误。这是我无法运行的教程中的代码,因为第3行有错误 class RoundOne{ public static void main(String[] args){ for(int i =0,i<10,i++){ System.out.println("The number is: "+i); } } } 你写了,而不是 在for循环中,而不是 for(int i =0,i<10
class RoundOne{
public static void main(String[] args){
for(int i =0,i<10,i++){
System.out.println("The number is: "+i);
}
}
}
你写了,而不是 在for循环中,而不是
for(int i =0,i<10,i++)
写
for(int i =0;i<10;i++)
供循环使用;在部分之间,而不是
变,变,;在for循环中。将逗号更改为分号。这就是在Java中使用分号而不是逗号分隔语句的方式。我不确定教程中是这样的,您只是复制了错误的语句,并声称是这样的。
for(int i =0;i<10;i++)
class RoundOne {
public static void main(String[] args) {
for (int i = 0; i < 10; i++) {
System.out.println("The number is: " + i);
}
}
}