为什么编译会提示软件包不存在,大家帮忙看看代码- import java.util.*;
- class Arraylist
- {
- public static void sop(Object obj)
- {
- System.out.println(obj);
- }
- public static void main(String[] args)
- {
- ArrayList al=new ArrayList();
- al.add("java01");
- al.add("java02");
- al.add("java01");
- al.add("java02");
- al.add("java01");
- al.add("java03");
- sop(al);
- al=qccf(al);
- sop(al);
- }
- public static ArrayList qccf(ArrayList al)
- {
- ArrayList newal=ArrayList;
- Iterator it=new al.iterator();
- while(it.hasNext())
- {
- Object obj=it.next();
- if(!newal.contains(obj))
- newal.add(obj);
-
- }
- return newal;
- }
- }
复制代码 |