
你的问题是:类型不匹配,不能赋值。
位置在:
int [] locations = {randomNum, randomNum+1,randomNum+2};theDotComsetLocationCells(locations);
locations 是int型数组,而setLocationCells(ArrayList<String> loc) 需要的参数是集合类型
你可以定义:
int randomNum = (int) (Mathrandom() 5);int [] locations = {randomNum, randomNum+1,randomNum+2};
ArrayList<String> loc = new ArrayList<String>();
for (int i=0;i<locationslength;i++){
locadd(StringvalueOf(locations[i]));
}
theDotComsetLocationCells(loc);
--希望对你有帮助!
以上就是关于java:如下程序运行时出现如下错误,怎样修改全部的内容,包括:java:如下程序运行时出现如下错误,怎样修改、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)