//接口
public interface Inter {
void show();
}
public class Outer {
public void method(){
new Inter(){
@Override
public void show() {
System.out.println(" 这是匿名内部类");
}
}.show();
}
}
public class OuterDemo {
public static void main(String[] args) {
Outer outer = new Outer();
outer.method();
}
}