public class ListDemo {
public static void main(String[] args) {
String s="apple pear banana orange";
List list=Arrays.asList(s.split(" "));
System.out.println("集合中最小元素:"+Collections.min(list));
System.out.println("集合中最大元素:"+Collections.max(list));
Iterator iter1=list.iterator();
while(iter1.hasNext()) {
System.out.print("排序后集合元素输出:"+iter1.next()+" ");
}
}
}