package seven_topic; import java.util.ArrayList; import java.util.List; public class p_19_2 { @SuppressWarnings("unchecked") public static void main(String[] args) { String Array[] = new String[] { "Kangkang", "张", "Michael", "Rose", "Kangkang", "张", "Aja", "Seven7", "啊Ar", "赵" }; @SuppressWarnings("rawtypes") List list = new ArrayList(); for (int i = 0; i < Array.length; i++) { if (!list.contains(Array[i])) { list.add(Array[i]); } } for (int n = 0; n < list.size(); n++) { String str = (String) list.get(n); System.out.println(str); } System.out.println(list); } }