class StaticClass
{
public static void main(String[] args)
{
String name = new StaticClass().new InnerTest("aaa").getName();
System.out.println(name);
class InnerTest
{
private String name;
InnerTest(String name)
{
this.name=name;
}
public String getName()
{
return name;
}
}
}
}
怎么才能访问内部类的那个方法呢?
|
|