public class Group3
{
private static int count;
private String name;
public class Student
{
private int count;
private String name;
public void output( int count )
{
count ++;
this.count ++;
Group3.count ++;
Group3.this.count ++;
System.out.println ( count + " " + this.count + " " + Group3.count +
" " + Group3.this.count++);
}
}
public static void main(String[] args)
{
Group3 g3 = new Group3();
g3.count = 10;
Group3.Student s1 = g3.new Student();
s1.output(5);
}
}
内部类的程序,红色部分那个count的值搞不懂,最后结果输出怎么是6 1 12 12
麻烦知道的提醒一下小弟,在此谢过!