08 2011 档案

摘要:1 public class AnmInnerClass { 2 3 /** 4 * @param args 5 * 匿名类,也叫匿名内部类,是对原类的集成并且直接实例化的对象 6 */ 7 public static void main(String[] args) { 8 // TODO Auto-generated method stub 9 Foo foo=new Foo(){10 public int getA(){11 System.out.println("调用了getA()");12 return super.getA();13 }14 };15 Syste 阅读全文
posted @ 2011-08-02 10:48 牧涛 阅读(253) 评论(1) 推荐(0) 编辑
摘要:1 import java.util.ArrayList; 2 import java.util.List; 3 4 public class ListDemo { 5 6 /** 7 * @param args 8 */ 9 public static void main(String[] args) {10 // TODO Auto-generated method stub11 List<Song> songs = new ArrayList<Song>();12 songs.add(new Song("花好月圆","")) 阅读全文
posted @ 2011-08-02 10:42 牧涛 阅读(371) 评论(0) 推荐(0) 编辑