各位师兄,小弟在编的一个简单的小程序出现以下情况,令小弟百思不得其解,请各位帮助
public class TestJ
{
public static void main(String[] args)
{
int[][] a={
{1,2,3,4,5},
{6,7,8,9,10},
{11,12,13,14,15},
};
for(int i=0;i<a.length;i++)
for(int j=0;j<a[i].length;j++)
if(a[i][j]==10)
a[i][j]=0;
System.out.println(a);
}
}
结果: [[I@@198dfaf
如果改为:System.out.println(a[i][j])
则出现以下错误:
TestJ.java:15: cannot resolve symbol
symbol : variable i
location: class TestJ
System.out.println(a[i][j]);
^
TestJ.java:15: cannot resolve symbol
symbol : variable j
location: class TestJ
System.out.println(a[i][j]);
^
2 errors