日期:2014-05-20  浏览次数:20847 次

急急
我有2个数组:
String[] stra=new String[]{"1","2","3"};
String[] strb=new String[]{"4","5","6"};
我想把他放进list中,然后打印list是呈现如下格式:
[[1,A],[2,A],[3,A],[4,A],[5,A],[6,A]]

------解决方案--------------------
String[] stra=new String[]{"1","2","3"}; 
String[] strb=new String[]{"4","5","6"};
int intall=stra.length+strb.length;
String[] strc=new String[intall];
int ik=0;
for(int i=0;i<stra.length;i++){
strc[ik++]=stra[i];
}
for(int i=0;i<strb.length;i++){
strc[ik++]=strb[i];
}

for(int i=0;i<strc.length;i++){
System.out.println("strc iiiii="+strc[i]);
}
可以搞定啦,你可以试试看,我已经测试过,ok呀,list 的操作就不介绍啦!