标签:style blog http ar color sp java on div
import java.util.*; //15天13听的不是很懂 class GenericDemo { public static void main(String[] args) { ArrayList<Person> a = new ArrayList<Person>(); a.add(new Person("a")); a.add(new Person("b")); a.add(new Person("c")); Iterator it = al.iterator(); while(it.hasNext()) { String s = it.next(); //注意这里缺少了向下转型 System.out.println(s); } ArrayList<Stu> al1 = new ArrayList<Stu>(); al1.add(new Stu("A"));
al1.add(new Stu("B")); al1.add(new Stu("C")); printCln(al1); }
}
标签:style blog http ar color sp java on div
原文地址:http://www.cnblogs.com/tozr/p/4117984.html