List类 List在这里就是一个类
List<String> lists = new String[]{'1','3'};
List<String> list1 = new String[]{'5','4'};
lists.set(0,'a');
lists.add(0,'b');
lists.add('2');
lists.addAll(list1);
for(String item : lists){
System.debug('item:' + item);
}
Iterator<String> iterator = lists.iterator();
while(iterator.hasNext()){
String item = iterator.next();
System.debug('通过iterator遍历:'+item);
}
if(lists.size()>0){
Integer listSize = lists.size();
lists.remove(listSize-1);
}
List<String> cloneList = lists.clone();
for(Integer i=0;i<cloneList.size();i++){
System.debug('cloneListItem:' + cloneList.get(i));
}
lists.clear();
if(lists.size()>0){
for(String item:lists){
System.debug('set item:' + item);
}
}
else{
System.debug('lists has already clear');
}