0%

匿名内部类

文章字数:19,阅读全文大约需要1分钟

1
2
3
4
5
6
7
8
9
10
Inter i = new Inter(){//多态
public void show(){
System.out.println("show");
}
public void show2(){
System.out.println("show2");
}
};
i.show();//调用类方法
i.show2();