public class T { public static void main(String[] args) { // 定义二维字符串数组 String[][] str2Arr1 = new String[][]{{"Hello!","susan14"}, {"Happy","Yzl","Very"}, {"Two","One"}};
String[][] str2Arr2 = new String[][]{{"One!","Two"}, {"Three","Yzl","Four"}, {"Two","One"}};
//定义一维数组(它包含二维字符串) Object[] obj = new Object[]{str2Arr1,str2Arr2};
// 输出 for(int i = 0; i < obj.length; i ++) { String[][] tmp = (String[][])obj[i]; for (int j = 0; j < tmp.length; j ++) for (int k = 0; k < tmp[j].length; k ++) System.out.print(tmp[j][k]); System.out.println(); } } }
{
static public void main( String args[] ) {
String[] s1 = new String[]{"1","2"};
String[] s2 = new String[]{"3","4"};
String[][] s3 = new String[][]{s1,s2};
for(int i=0;i<s1.length;i++){
for(int c=0;c<s2.length;c++){
System.out.println(s3[i][c]);
}
}
}
}
{
public static void main(String[] args)
{
// 定义二维字符串数组
String[][] str2Arr1 = new String[][]{{"Hello!","susan14"},
{"Happy","Yzl","Very"},
{"Two","One"}};
String[][] str2Arr2 = new String[][]{{"One!","Two"},
{"Three","Yzl","Four"},
{"Two","One"}};
//定义一维数组(它包含二维字符串)
Object[] obj = new Object[]{str2Arr1,str2Arr2};
// 输出
for(int i = 0; i < obj.length; i ++)
{
String[][] tmp = (String[][])obj[i];
for (int j = 0; j < tmp.length; j ++)
for (int k = 0; k < tmp[j].length; k ++)
System.out.print(tmp[j][k]);
System.out.println();
}
}
}