本帖最后由 以计盛 于 2013-1-21 00:29 编辑
public class text9 {
public static void main(String[] args) {
Student s1 = new Student();
GoodStudent s2 = new GoodStudent();
}
}
就在这提示已定义类型 person class Person{
Person()
{
System.out.println("Person类");
}
Person(String str)
{
System.out.println(str);
}
}
class Student extends Person {
Student() {
System.out.println("Student类!");
}
Student(String str) {
System.out.println(str);
}
}
class GoodStudent extends Student
{
GoodStudent() {
System.out.println(" GoodStudent类!");
}
} |