注意:此页面搜索的是所有试题
题目内容
(湖南大学-网络编程)
设有下面两个类的定义:
class Person { class Student extends Person {
long id; // 身份证号 int score; // 入学总分
String name; // 姓名 int getScore(){
} return score;
}
}
则类Person和类Student的关系是( B )。
A、包含关系 B、继承关系 C、关联关系 D、上述类定义有语法错误
class Person { class Student extends Person {
long id; // 身份证号 int score; // 入学总分
String name; // 姓名 int getScore(){
} return score;
}
}
则类Person和类Student的关系是( B )。
A、包含关系 B、继承关系 C、关联关系 D、上述类定义有语法错误
参考答案

