class Demo {
public static void main(String[] args) {
Outer o = new Outer();
o.method();
}
}
interface Inter {
public void show1();
public void show2();
}
class Outer {
public void method() {
Inter i = new Inter() {
public void show1() {
System.out.println("show1");
}
public void show2() {
System.out.println("show2");
}
};
i.show1();
i.show2();
}
} |
|