List list = new ArrayList();
list.add(2);
list.add(1);
list.remove(1); // 1
Iterator it = list.iterator(); //2
while(it.hasNext()){ // 3
int number = it.next(); // 4
System.out.println(number+1);
}
哪行代码编译会出现问题( D )
A 1
B 2
C 3
D 4
集合没有指明泛型,获取数据需要强转
标签:强转,list,number,获取数据,泛型,指明 From: https://www.cnblogs.com/cn-iwish/p/17185124.html