A-A+

设有下面两个类的定义: class Person{ long id;// 身份证号 Stri

2022-08-06 03:33:27 问答库 阅读 175 次

问题详情

设有下面两个类的定义: class Person{ long id;// 身份证号 String name://姓名 } class Student extends Person{ int score://成绩 int getScore(){ return score; } } 则类Person和类Student的关系是()。
A.包含关系
B.继承关系
C.关联关系
D.无关系请帮忙给出正确答案和分析,谢谢!

参考答案

正确答案:B

考点:身份证号,定义