原始数据:
A1 A2 A3 A4
B1 B2 B3 B4
C1 C2 C3 C4
转换后的数据:
A1 B1 C1
A2 B2 C2
A3 B3 C3
A4 B4 C4
public static void main(String[] args) {
List list=new ArrayList();
Object []rows1=new Object[]{"A1","A2","A3","A4"};
Object []rows2=new Object[]{"B1","B2","B3","B4"};
Object []rows3=new Object[]{"C1","C2","C3","C4"};
list.add(rows1);
list.add(rows2);
list.add(rows3);
for (int i = 0; i < list.size(); i++) {
Object []objs=(Object[])list.get(i);
for (int j = 0; j < objs.length; j++) {
System.out.print(objs[j]);
}
System.out.println();
}
在此添加代码:
}