30 lines
590 B
Java
30 lines
590 B
Java
|
package exp6;
|
||
|
|
||
|
interface InnerAnonymousInterface {
|
||
|
void fun1();
|
||
|
void fun2();
|
||
|
void fun3();
|
||
|
}
|
||
|
|
||
|
abstract class Outer implements InnerAnonymousInterface{
|
||
|
}
|
||
|
|
||
|
|
||
|
public class AdapterDemo {
|
||
|
public static void main(String[] args) {
|
||
|
Outer o = new Outer(){
|
||
|
public void fun1(){
|
||
|
System.out.println("方法1");
|
||
|
}
|
||
|
public void fun2(){
|
||
|
System.out.println("方法2");
|
||
|
}
|
||
|
public void fun3(){
|
||
|
System.out.println("方法3");
|
||
|
}
|
||
|
};
|
||
|
|
||
|
o.fun1();
|
||
|
}
|
||
|
}
|