Java面向对象 继承类的一些特殊写法

来源:互联网 发布:定时器软件 编辑:程序博客网 时间:2024/06/09 17:09
package test;interface Inter {void func();}public class Demo {public static void main(String[] args) {new Demo().show(new Inter() {public void func() {System.out.println("hello");}});}void show(Inter inter) {inter.func();}}

0 0
原创粉丝点击