Syntax error on token "new", invalid Expression 5
publicclassA5_10{publicstaticvoidmain(String[]agrs){int[]arrA={1,2,3,4,5,6,7,8};int[]...
public class A5_10 {
public static void main(String[]agrs){
int [] arrA={1,2,3,4,5,6,7,8};
int [] arrB=new [arrA.length];
for(int i=0;i<arrA.length;i++){
arrB[i]=arrA[i];
}
for(int i=0;i<arrA.length;i++){
System.out.print(arrB[i]);
}
}
}
-------------------------------------------------------------------------------------------------------------
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Syntax error on token "new", invalid Expression
at A5_10.main(A5_10.java:5) 展开
public static void main(String[]agrs){
int [] arrA={1,2,3,4,5,6,7,8};
int [] arrB=new [arrA.length];
for(int i=0;i<arrA.length;i++){
arrB[i]=arrA[i];
}
for(int i=0;i<arrA.length;i++){
System.out.print(arrB[i]);
}
}
}
-------------------------------------------------------------------------------------------------------------
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Syntax error on token "new", invalid Expression
at A5_10.main(A5_10.java:5) 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询