
已解决问题
谷歌thelifezp43用户在2013.07.01提交了关于“三十而已j**a 程序运行错误”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2024-11-06T11:02:05。importj**a.util.*;publicclassGame21{
publicstaticvoidmain(String[]args){
ArrayList<Integer>ZhiPai=newArrayList();
inti=1;
while(i<=53){
ZhiPai.add(i);
}
System.out.println(ZhiPai);
for(intj=1;j<50;j++){
inttemp,theRandom1,theRandom2;
theRandom1=(int)(Math.random()*53);
theRandom2=(int)(Math.random()*53);
temp=ZhiPai[theRandom1];ZhiPai[theRandom1]=ZhiPai[theRandom2];ZhiPai[theRandom2]=temp;
}
System.out.println(ZhiPai);
}
}
运行时错误:
Exceptioninthread"main"j**a.lang.Error:Unresolvedcompilationproblems:
ThetypeoftheexpressionmustbeanarraytypebutitresolvedtoArrayList<Integer>
ThetypeoftheexpressionmustbeanarraytypebutitresolvedtoArrayList<Integer>
ThetypeoftheexpressionmustbeanarraytypebutitresolvedtoArrayList<Integer>
ThetypeoftheexpressionmustbeanarraytypebutitresolvedtoArrayList<Integer>
atgame21.Game21.main(***.j**a:18)希望大家能够帮助她。
详细问题描述及疑问:importj**a.util.*;
publicclassGame21{
publicstaticvoidmain(String[]args){
ArrayList<Integer>ZhiPai=newArrayList();
inti=1;
while(i<=53){
ZhiPai.add(i);
}
System.out.println(ZhiPai);
for(intj=1;j<50;j++){
inttemp,theRandom1,theRandom2;
theRandom1=(int)(Math.random()*53);
theRandom2=(int)(Math.random()*53);
temp=ZhiPai[theRandom1];ZhiPai[theRandom1]=ZhiPai[theRandom2];ZhiPai[theRandom2]=temp;
}
System.out.println(ZhiPai);
}
}
运行时错误:
Exceptioninthread"main"j**a.lang.Error:Unresolvedcompilationproblems:
ThetypeoftheexpressionmustbeanarraytypebutitresolvedtoArrayList<Integer>
ThetypeoftheexpressionmustbeanarraytypebutitresolvedtoArrayList<Integer>
ThetypeoftheexpressionmustbeanarraytypebutitresolvedtoArrayList<Integer>
ThetypeoftheexpressionmustbeanarraytypebutitresolvedtoArrayList<Integer>
atgame21.Game21.main(***.j**a:18)期待您的答案,希望你能感受到,我最真诚的谢意
!