用Eclipse编译java代码,出现如下错误 新手求助!

hzq19950201 2013-04-09 10:52:18
import java.util.Random;
public class hzq {
static Random rand=new Randow();
static int pRand(int mod){
return Math.abs(rand.nextInt())%mod +1;
}
public static void main(String[] args){
int[][] a={{1,2,3},{4,5,6}};
for(int i=0 ;i<a.length;i++){
for(int j=0 ;j<a.length;j++){
System.out.println("a["+i+"]"+"["+j+"]:"+a[i][j]);
}
}
integer[][] a1={{new integer(1),new integer(2)},{new integer(3),new integer(4)},{ new integer(5),new integer(6)}};
for(int i=0 ;i<a.length;i++){
for(int j=0;j<a[i].length;j++){
System.out.println("a1["+i+"]"+"["+j+"]:"+a1[i][j]);
}
}
Integer[][] a2;
a2=new integer[3][];
for(int i=0;i<a2.length;i++){
a2[i]=new integer[3];
for(int j=0 ;j<a2[i]; i++){
for(int j=0 ;j<a.length;j++){
System.out.println("a2["+i+"]"+"["+j+"] :"+a2[i][j]);

}
}
}
}
}

错误信息:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
integer cannot be resolved to a type
integer cannot be resolved to a type
integer cannot be resolved to a type
integer cannot be resolved to a type
integer cannot be resolved to a type
integer cannot be resolved to a type
integer cannot be resolved to a type
integer cannot be resolved to a type
integer cannot be resolved to a type
The operator < is undefined for the argument type(s) int, Integer[]
Duplicate local variable j

at hzq.main(hzq.java:14)
...全文
121 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
STEEL-CHINA 2013-04-10
  • 打赏
  • 举报
回复
for (int i = 0; i < a.length; i++) { for (int j = 0; j < a[i].length; j++) { System.out.println("a1[" + i + "]" + "[" + j + "]:" + a1[i][j]); } } ======================== 问多不少,请楼主理清楚一下。
STEEL-CHINA 2013-04-10
  • 打赏
  • 举报
回复
for(int i=0;i<a2.length;i++){ a2[i]=new integer[3]; for(int j=0 ;j<a2[i]; i++){ for(int j=0 ;j<a.length;j++){ ============================ 什么情况,麻烦楼主把你要的东西写清楚。
Inhibitory 2013-04-09
  • 打赏
  • 举报
回复
new integer(3) 是 new Integer(3) i要大写

50,530

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧