日期:2014-05-20 浏览次数:20667 次
public class Test2
{
public static void main(String[] args)
{
A x = new A();
System.out.println(x.a);
A.B y = x.new B();
System.out.println(y.b);
A.B m = new A().new B();
System.out.println(m.b);
System.out.println(m.c); //这一步有误,怎样改?
}
}
class A
{
int a = 5;
public class B
{
int b = 6;
public B()
{
int c = 10;
}
}
}
public class Test2
{
public static void main(String[] args)
{
A x = new A();
System.out.println(x.a);
A.B y = x.new B();
System.out.println(y.b);
A.B m = new A().new B();
System.out.println(m.b);
//System.out.println(m.c); //这一步有误,怎样改?
}
}
class A
{
int a = 5;
public static class B
{
int b = 6;
public B()
{
int c = 10;
}
}
}