Java SE学习中遇到的两个程序补全问题,本人不解,希望请教各位!
1、
public class Test0 {
public static void main(String[] args) {
ArrayList list = new ArrayList();
list.add("a");
list.add("b");
list.add("c");
//使用foreach循环遍历元素
for ( ??? ){
System.out.println(obj);
}
}
}
2、
public class Test1 {
public static void main(String[] args) {
TreeSet ts = new TreeSet();
ts.add("b");
ts.add("a");
ts.add("c");
ts.add("c");
Iterable it = ts.iterator();
while ( ??? ){
System.out.println(it.next());
}
}
}