• 2022-06-08
    已知:创建一个ArrayList集合,向集合中添加2个元素,遍历集合,将以下()代码补全。importjava.util.ArrayList;publicclass集合{publicstaticvoidmain(String[]args){ArrayList<()>arrayList=newArrayList<>();arrayList.()("苹果");arrayList.()("香蕉");System.out.println(arrayList);for(inti=0;i<();i++){Strings=arrayList.()(i);System.out.print(s);}}}