【发布时间】:2014-09-17 15:52:33
【问题描述】:
我正在尝试运行此循环,但我不断收到错误:
需要标识符
'.class' 预期
都在第 4 行
public static void main(String[] args) {
int[] x = {98, 30, 97, 10, 5};
int[] y = new int[5];
for (int i = 0, int j = 4 ; i <= 4 && j >= 0; i++,j-- )
{
System.out.print(x[i]);
}
}
【问题讨论】:
-
这是一个“主要”方法。是在班级里面吗?例如
public class MyClass { <your main method> }? -
for(int i=0,j=4 . . 会做
-
不要做奇怪的事情。你将没有朋友。