程序出错 ,不解。。求大侠帮帮忙啊!!
package com.lin;public class GroupFour {
public static class Student{
static int count;
String name;
int number;
public Student(String n1){
name=n1;
count++;
number=count;
}
public void output(){
System.out.println(this.name+" number="+this.number);
}
}
public static void main(String[] args) {
GroupFour.Student s=new GroupFour.Student("lin");
//上面的语句怎么不可以换成:GroupFour.Student s=new GroupFour().new Student("lin");
//之前有个类似的程序是这样的。但这个就运行出错。何解呢?求大侠帮助!!!
s.output();
}
}