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

设有下列两个类的定义,则类Person和类Man的关系是( )。 class Person { long id; //身份证号 String name; //姓名 } class Man extends Person { int age; //年龄 int getAge() { return age; } }

A.包含关系

B.继承关系

C.关联关系

D.无关系,上述类定义有语法错误


相关考题:

( 30 )下列代码声明了 3 个类class Person{};class Student:public Person{};class Undergraduate:Student{};下列关于这些类之间关系的描述中,错误的是A )类 Person 是类 Undergraduate 的基类B )类 Undergraduate 从类 Student 公有继承C )类 Student 是类 Person 的派生类D )类 Undergraduate 是类 Person 的派生类

设有下面两个类的定义:classperson{longid;//身份证号stringname;//姓名}classstudentextendsperson{intscore;//入学总分intgetscore(){returnscore;}}则类person和类student的关系是_________。 A.关联关系B.上述类定义有语法错误C.继承关系D.包含关系

下列代码段中声明了3个类: Class Person{}; Class Student:publiC Person{}; Class Undergraduate:Student{}; 下列关于这些类之间关系的描述中,错误的是( )。A.类Person是类Undergraduate的基类B.类Undergraduate从类Student公有继承C.类Student是类Person的派生类D.类Undergraduate是类Person的派生类

设有下列两个类的定义,则类Person和类Man的关系是 ( ) class Person{ long id;//身份证号 Stringname;//姓名 } class Man extends Person{ int age;//年龄 int getScore(){ return score; } }A.包含关系B.继承关系C.关联关系D.无关系,上述类定义有语法错误

设有下面两个类的定义: class Person{ long id // 身份证号 String name; //姓名 } class Student extends Person{ int score: //成绩 int getScore ( ) { return score; } } 则类Person和类Student的关系是( )。A.包含关系B.继承关系C.关联关系D.无关系

设有下面两个类的定义。 class Person { long id; // 身份证号 String name; // 姓名 } class Student extends Person { int score; // 入学总分 } intgetScore() { return score;} } 则类Person和类Student的关系是? } A.包含关系B.继承关系C.关联关系D.上述类定义有语法错误

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

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

设有下面两个类的定义: class Person{ long id;// 身份证号 String name://姓名 } class Student extends Person{ int score://成绩 int getScore( ){ return score; } } 则类Person和类Student的关系是( )。A.包含关系B.继承关系C.关联关系D.无关系