重要提示:请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
首页 > 计算机科学与技术> 面向对象程序设计
网友您好,请在下方输入框内输入要搜索的题目:
搜题
拍照、语音搜题,请扫码下载APP
扫一扫 下载APP
题目内容 (请给出正确答案)
[单选题]

类Teacher和Student是类Person的子类; Person p; Teacher t; Student s; //p, t and s are all non-null. if(t instanceof Person) { s = (Student)t; } 最后一句语句的结果是:()

A.将构造一个Student对象;

B.表达式是合法的;

C.表达式是错误的;

D.编译时正确,但运行时错误。

答案
查看答案
更多“类Teacher和Student是类Person的子类; Person p; Teacher t; Student s; //p, t and s are all non-null. if(t ins…”相关的问题

第1题

设有下面两个类的定义:class Person{long id; String name;} class Student extends Person{int score; int getScore(){return score;}} 则类 Person 和类 Student 的关系是()。

A.继承关系

B.无关系

C.包含关系

D.关联关系

点击查看答案

第2题

已知stu1和stu2是Student类的两个对象,则执行“stu1stu2”时会自动执行Student类的方法。()

A、__gt__

B、__ge__

C、__lt__

D、__le__

点击查看答案

第3题

Student: I'm nervous. Teacher:______. Betty, you'll finish it quickly.

Student: I'm nervous.

Teacher:______. Betty, you'll finish it quickly.

点击查看答案

第4题

已知Student类是一个空类,stu1和stu2是Student类的两个对象,则通过“stu1.name='李晓明'”语句增加的属性可以通过()访问。

A.Student.name、stu1.name或stu2.name

B.Student.name或stu1.name

C.stu1.name或stu2.name

D.stu1.name

点击查看答案

第5题

The teacher tried to make the new student feel______.A.with easeB.at leisureC.at easeD.at

The teacher tried to make the new student feel______.

A.with ease

B.at leisure

C.at ease

D.at rest

点击查看答案

第6题

若把学生看成一个实体,它可以分成多个子实体,如小学生、中学生和大学生等。在面向对象的设计中,可以创建如下4个类:类Student、类Elementary Student、Middle Student;类University Student。试给出这4个类的属性以及它们之间的关系。

点击查看答案

第7题

The Indian was_______.A.the doctorB.the patientC.the teacherD.the student

The Indian was_______.

A.the doctor

B.the patient

C.the teacher

D.the student

点击查看答案

第8题

“teacher” and “student” are converses.()

“teacher” and “student” are converses.()

点击查看答案

第9题

Which of the following is TRUE of teacher's correction of his student's writing errors?A.I

Which of the following is TRUE of teacher's correction of his student's writing errors?

A.It is good to correct all the errors

B.A teacher should write something on the papers to encourage his students

C.A teacher' s handwriting must be tidy and clear

D.A teacher had better point out the way for each student to improve his writing

点击查看答案

第10题

【D6】STUDENT:I MEAN I WANT TO DO SOME OF THESE PROBLEMS. TEACHER: YEAH. STUDENT:BUT IT" S

【D6】

STUDENT:I MEAN I WANT TO DO SOME OF THESE PROBLEMS. TEACHER: YEA

H. STUDENT:BUT IT" S TAKING TIME TO DO THE

M. TEACHER:WHEN WE COVER SOMETHING IN THE LESSON,【D5】______WORK OUT THE EXERCISES IN IT. ERM, WHEN YOU GET A LITTLE BIT STUCK,SORT IT OUT YOURSELF, AND THEN THIN

K. STUDENT: YEA

H.______ TEACHER: I KNOW I SEE HOW YOU DO IT. AND MAYBE IF YOU" RE TOTALLY STUCK,【D6】______STUDENT: YEA

H. TEACHER:IT" S REALLY THE MORE YOU DO, MM, ON YOUR OW

N. BECAUSE【D7】______YOU" RE GONNA BE ON YOUR OW

N. KEEP WORKING ON IT AND YOU"LL BE OKAY. A. WHEN IT COMES TO THE EXAM,

B. YOU NEED TO GO OVER IT YOURSEL

F.

C. THEN I CAN GO THROUGH IT AGAIN NEXT TIM

E.

D. YOU HAVE TO HAND IN YOUR HOMEWOR

K.

点击查看答案

第11题

已知Student类有一个类属性__id,stu是Student类的对象,则利用stu访问__id属性的正确方法是()。

A.stu.__id

B.stu._stu__id

C.stu._Student__id

D.stu._Student.__id

点击查看答案
下载APP
关注公众号
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案 购买前请仔细阅读《购买须知》
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《服务协议》《购买须知》
立即支付 系统将自动为您注册账号
已付款,但不能查看答案,请点这里登录即可>>>
请使用微信扫码支付(元)

订单号:

遇到问题请联系在线客服

请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示:请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
请用微信扫码测试
优题宝