类Student的声明如下:packagecom.schoolclassStudent{Stringname;intage;Student(Stringname,intage){//code}voidstudy(Stringsubject){//code}}正确调用方法study(Stringsubject)的是哪项?() A.Studentstu=newStudent(“Tom”,23);stu.study(“数学”);B.Student.study(“数学”);C.Studentstu=newStudent(“Tom”,23);stu.study();D.Studentstu=newStudent(“Tom”,23);Stringresult=stu.study(“数学”);

类Student的声明如下:packagecom.schoolclassStudent{Stringname;intage;Student(Stringname,intage){//code}voidstudy(Stringsubject){//code}}正确调用方法study(Stringsubject)的是哪项?()

A.Studentstu=newStudent(“Tom”,23);stu.study(“数学”);

B.Student.study(“数学”);

C.Studentstu=newStudent(“Tom”,23);stu.study();

D.Studentstu=newStudent(“Tom”,23);Stringresult=stu.study(“数学”);


相关考题:

类Student中字段mark的缺省值是哪项?()ClassStudent{Stringname;intage;floatmarket;·········} A.0.0fB.numllC.falseD.0E.0.0

类Student代码如下:DclassStudent{Stringname;intage;Student(Stringnm){(构造方法)name=nm;}}执行语句Studentstu=newStudent()后,字段age的值是哪项?() A.0B.nullC.falseD.编译错误

类Student代码如下:classStudent{Stringname;intage;Student(Stringnm){name=nm;}}执行语句Studentstu=newStudent()后,字段age的值是哪项?() A.0B.nullC.falseD.编译错误

Person p = new Person(“张三”,23);这条语句会调用下列哪个构造方法给属性进行初始化() A.public Person(){}B.public Person(String name,int age) { this.name = name; this.age = age; }C.public Person(int age,String name) { this.age = age; this.name = name; }D.public Person(String name) { this.name = name; }

2、假设student是一个含有name与age属性的结构体,如何调用学生的年龄信息? struct Student{ char name[20]; int age; }A.student.ageB.student->ageC.student[age]D.student(age)

以下哪个定义不会分配实际的存储空间?A.struct { char name[10] ; int age ; } student ;B.struct STUDENT { char name[10] ; int age ; } student ;C.struct STUDENT { char name[10] ; int age ; } ; struct STUDENT student;D.struct STUDENT { char name[10] ; int age ; } ;

以下()定义不会分配实际的存储空间。A.struct { char name[10] ; int age ; } student ;B.struct STUDENT { char name[10] ; int age ; } student ;C.struct STUDENT { char name[10] ; int age ; } ; struct STUDENT student;D.struct STUDENT { char name[10] ; int age ; } ;

【多选题】下面()是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、以下哪个定义不会分配实际的存储空间?A.struct { char name[10] ; int age ; } student ;B.struct STUDENT { char name[10] ; int age ; } student ;C.struct STUDENT { char name[10] ; int age ; } ; struct STUDENT student;D.struct STUDENT { char name[10] ; int age ; } ;