设有下列两个类的定义,则类Person和类Man的关系是( )。 class Person { long id; //身份证号 String name; //姓名 } class Man extends Person { int age; //年龄 int getAge() { return age; } }
A.包含关系
B.继承关系
C.关联关系
D.无关系,上述类定义有语法错误
第1题:
设有下面两个类的定义: class Person{ long id // 身份证号 String name; //姓名 } class Student extends Person{ int score: //成绩 int getScore ( ) { return score; } } 则类Person和类Student的关系是( )。
A.包含关系
B.继承关系
C.关联关系
D.无关系
第2题:
设有下列两个类的定义,则类Person和类Man的关系是 class Person { long id;/ / 身份证号 String name;/ / 姓名 } class Man extends Person { int age;/ / 年龄 int getScore( ) { return score; } }
A.包含关系
B.继承关系
C.关联关系
D.无关系,上述类定义有语法错误
第3题:
设有下面两个类的定义: class Person{ long id;// 身份证号 String name://姓名 } class Student extends Person{ int score://成绩 int getScore( ){ return score; } } 则类Person和类Student的关系是( )。
A.包含关系
B.继承关系
C.关联关系
D.无关系
第4题:
A.包含关系
B.继承关系
C.关联关系
D.上述类定义有语法错误
第5题:
设有下列两个类的定义,则类Person和类Man的关系是( )。 class Person{ long id; //身份证号 Stringname;//姓名 } class Man extends Person{ int age;//年龄 int getScore(){ return score; } }
A.包含关系
B.继承关系
C.关联关系
D.无关系,上述类定义有语法错误