class test{
public static void main(String arv[]){
D d=new D();
A.b ab=new C();
d.display(ab);
d.display(new A.b() {
@Override
public void fun() {
// TODO Auto-generated method stub
System.out.println("类里面的接口的使用");
}
});
}
}
class A{
int i;
public static interface b{
public void fun();
}
public static C b() {
// TODO Auto-generated method stub
return null;
}
}
class C implements A.b{
@Override
public void fun() {
// TODO Auto-generated method stub
System.out.println("类里面的接口");
}
}
class D{
void display(A.b d){
d.fun();
}
}
public static void main(String arv[]){
D d=new D();
A.b ab=new C();
d.display(ab);
d.display(new A.b() {
@Override
public void fun() {
// TODO Auto-generated method stub
System.out.println("类里面的接口的使用");
}
});
}
}
class A{
int i;
public static interface b{
public void fun();
}
public static C b() {
// TODO Auto-generated method stub
return null;
}
}
class C implements A.b{
@Override
public void fun() {
// TODO Auto-generated method stub
System.out.println("类里面的接口");
}
}
class D{
void display(A.b d){
d.fun();
}
}