public static void main(String[] args)
{
Object[] s = {123,"abc"};
List list = new ArrayList();
list.add(s);
for (int i = 0; i < list.size(); i++) {
Object[] obj=(Object[]) list.get(i);
for(Object o:obj){
System.out.println(o);
}
}
}
兄弟,上面这样做是否是有点多余;你是不是想下面这样:
public static void main(String[] args)
{
Object[] s = {123,"abc"};
List list = new ArrayList();
for(int i=0;i
}
for (int i = 0; i < list.size(); i++) {
System.out.println(list.get(i));
}
}
public static void main(String[] args) {
Object[] s = { 123, "abc" };
List list = new ArrayList();
list.add(s);
// System.out.println(list.size());
for (Object object : list) {
for (int i = 0; i < ((Object[]) object).length; i++) {
System.out.println(((Object[]) object)[i]);
}
}
}
list.get(i).toString()
0bject[] s?···错误里面不是说了?