class Outer
{
int x=3;
public void function()
{
new AbsDemo()
{
void show()
{
System.out.println("x="+x);
}
interface Test
{
static class Inner implements Inner
{
public void method()
{
System.out.println("method run");
}
}
}
static Inter function()
{
return new Inner();
}
}
class InnerClassTest
{
public static void main(String[] args)
{
Test.function().method();
}
}
相关分类