interface Inter
{
void show1();
void show2();
}
class Outer
{
public void method()
{
Inter in=new Inter()
{
public void show1()
{
System.out.print("show1");
}
public void show2()
{
System.out.print("show2");
}
};
in.show1();
in.show2();
}
}
class hello
{
public static void main(String [] args)
{
show(new Inter()
{
public void show1(){}
public void show2(){}
});
}
public static void show(Inter in)
{
in.show1();
in.show2();
}
}
有点看不太懂,求大神给讲讲
