匿名实现类示例
/**
* @auto dh
* @create 2020-04-29-9:31
*/
interface Id010{
void run();
default void test(){
System.out.println("hello ,I am default method");
}
static void test1(){
System.out.println("hello,I am static method");
}
}
public class Test010 {
public static void main(String[] args) {
Id010 id=new Id010(){
@Override
public void run() {
System.out.println("hello new world");
}
};
id.run();
id.test();
Id010.test1();
}
}