设有下列两个类的定义,则类Person和类Man的关系是 ( ) class Person{ long id;//身份证号 Stringname;//姓名 } class Man extends Person{ int age;//年龄 int getScore(){ return score; } }
A.包含关系
B.继承关系
C.关联关系
D.无关系,上述类定义有语法错误
第1题:
【多选题】下面()是Person类的构造方法。
A.private Person(){ }
B.Person(String name,int age){ }
C.person(String name,int age){ }
D.public Person(String name,int age,char sex){ }
E.public void Person(String name,int age,char sex){ }
第2题:
设有下面两个类的定义: class Person{ long id;// 身份证号 String name://姓名 } class Student extends Person{ int score://成绩 int getScore( ){ return score; } } 则类Person和类Student的关系是( )。
A.包含关系
B.继承关系
C.关联关系
D.无关系
第3题:
设有下列两个类的定义,则类Person和类Man的关系是( )。 class Person{ long id; //身份证号 Stringname;//姓名 } class Man extends Person{ int age;//年龄 int getScore(){ return score; } }
A.包含关系
B.继承关系
C.关联关系
D.无关系,上述类定义有语法错误
第4题:
设有下列两个类的定义,则类Person和类Man的关系是 class Person { long id;/ / 身份证号 String name;/ / 姓名 } class Man extends Person { int age;/ / 年龄 int getScore( ) { return score; } }
A.包含关系
B.继承关系
C.关联关系
D.无关系,上述类定义有语法错误
第5题:
A.包含关系
B.继承关系
C.关联关系
D.上述类定义有语法错误
第6题:
设有下面两个类的定义: class Person{ long id // 身份证号 String name; //姓名 } class Student extends Person{ int score: //成绩 int getScore ( ) { return score; } } 则类Person和类Student的关系是( )。
A.包含关系
B.继承关系
C.关联关系
D.无关系
第7题:
A.关联关系
B.上述类定义有语法错误
C.继承关系
D.包含关系
第8题:
设有下列两个类的定义,则类Person和类Man的关系是( )。 class Person { long id; //身份证号 String name; //姓名 } class Man extends Person { int age; //年龄 int getAge() { return age; } }
A.包含关系
B.继承关系
C.关联关系
D.无关系,上述类定义有语法错误
第9题:
( 30 )下列代码声明了 3 个类
class Person{};
class Student:public Person{};
class Undergraduate:Student{};
下列关于这些类之间关系的描述中,错误的是
A )类 Person 是类 Undergraduate 的基类
B )类 Undergraduate 从类 Student 公有继承
C )类 Student 是类 Person 的派生类
D )类 Undergraduate 是类 Person 的派生类