遍历二维数组
找了半天实在没看出来哪里错了 请大神帮忙看看 附上代码
public class HelloWorld {
public static void main(String[] args) {
// 定义两行三列的二维数组并赋值
int[][] names={{"tom","jack","mike"},{"zhangsan","lisi","wangwu"}};
// 通过二重循环输出二维数组中元素的值
for (int i = 0; i <names[i].length ; i++) {
for (int j = 0; j < names[i].length; j++) {
System.out.println(names[i][j]);
}
//换行
System.out.println();
}
}
}