ImageVerifierCode 换一换
格式:DOCX , 页数:12 ,大小:135.81KB ,
资源ID:14155120      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/14155120.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(最新第七章继承多态练习题Word文档格式.docx)为本站会员(b****2)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

最新第七章继承多态练习题Word文档格式.docx

1、 public class Alpha extends Base public static void main( String args ) new Alpha(); new Base(); Base B: BaseBase C: 编译失败. D: 没有输出. E: 运行时异常.3. 程序的运行结果是?( ) 编译失败. B: hello from a C: hello from bD: hello from b E: hello from ahello from a hello from b4. 运行结果是: class TestSuper TestSuper(int i) class T

2、estSub extends TestSuper class TestAll public static void main (String args) new TestSub(); 编译失败. B: 程序运行没有异常. 第7行抛出异常. D: 第2行抛出异常.5. 程序的运行结果是? 0 B: 1 C: 2 D: 编译失败.6. 对于语句B is a D 和 B has a C,一下哪两种说法是正确的? ( )D是B. B:B是D. C:D是C. D:B是C. E:D继承 B. F:B 继承D.7. 运行结果是? 1 B: 2 C: 第8行编译失败. D: 第14行编译失败.8. 分析: p

3、ublic class ConstOver public ConstOver(int x, int y, int z) 哪两个是对ConstOver 的构造方法的重载? ( )ConstOver() B:protected int ConstOver() private ConstOver(int z, int y, byte x) public Object ConstOver(int x, int y, int z) E:public void ConstOver(byte x, byte y, byte z) 9. 运行结果是? 4,4 B: 4,5 C: 5,4 D: 5,5 E:10

4、. 分析: public class X public X aMethod() return this;1) public class Y extends X 2) 3) 在第2行可以插入哪两项?public void aMethod() B:private void aMethod() public void aMethod(String s) D:private Y aMethod() return null;public X aMethod() return new Y();11. 运行结果是?12. 以下哪两个重载了方法setVar()? ( ) public class Method

5、Over public void setVar(int a, int b, float c) private void setVar(int a, float c, int b) B:public int setVar(int a, float c, int b) return a;protected void setVar(int a, int b, float c) D:public int setVar(int a, int b, float c) return a;protected float setVar(int a, int b, float c) return c;13. 分析

6、:1) class BaseClass 2) private float x = 1.0f;3) protected void setVar(float f) x = f;4) 5) class SubClass extends BaseClass 6) private float x = 2.0f;7) / insert code here 8) 在第7行插入哪两个覆盖了方法setVar()?void setVar(float f) x = f; B:public void setVar(int f) x = f;public void setVar(float f) x = f; D:pu

7、blic double setVar(float f) return f;public final void setVar(float f) x = f; F:protected float setVar() x = 3.0f; return 3.0f;14. 运行结果是? 2 C: 运行时异常. D: 第8行编译错误. E: 第14行编译错误.15. 分析: protected int method1(int a, int b) return 0;在A的子类中,以下哪两个方法是合法的?public int method1(int a, int b) return 0; B:private i

8、nt method1(int a, long b) return 0;private int method1(int a, int b) return 0; D:public short method1(int a, int b) return 0;static protected int method1(int a, int b) return 0;16. 分析:1) public abstract class Test 2) public abstract void methodA();3) 4) public abstract void methodB()5) 6) System.out

9、.println(Hello7) 8) 哪两种改法,可以使程序通过编译?给方法methodA()加方法体 C:在Test的声明中去掉abstractB:用;替换第5-7行 D:在方法methodA()的声明中去掉abstract 在方法methodB()的声明中去掉abstract17. 运行结果是:1) abstract class AbstractIt 2) abstract float getFloat();4) public class AbstractTest extends AbstractIt 5) private float f1 = 1.0f;6) private float

10、 getFloat() return f1; 编译成功. B: 运行时异常. C: 第2行编译失败. D: 第6行编译失败.18. 在接口中哪两个方法的声明是合法的?void method1(); B:public void method2(); C:static public void method5();protected void method3(); E:final public void method4();19. 分析: 1) public interface Foo 2) int k = 4;哪三项与第2行等价?final int k = 4;public int k = 4;s

11、tatic int k = 4;abstract int k = 4; E:volatile int k = 4; F:protected int k = 4;20. 分析: interface Inter class A implements Inter class B extends A B() A arr = new A10; boolean b1 = this instanceof Inter; boolean b2 = arr instanceof Object; System.out.println(b1 = + b1 + , b2 = + b2);创建B的对象时会输出? b1 =

12、 true, b2 = true C: b1 = true, b2 = false b1 = false, b2 = true E: b1 = false, b2 = false21. 哪一个能通过编译? new Animal().soundOff(); B: Lion l = Alpha1.get(meat eater Elephant e = new Alpha1(); D: new Alpha1().get(veggie).soundOff();22. 分析: class Passenger class Engine interface TransportVehicle void loadPassengers(); interface Helicopter extends TransportVehicle int flyIt( String direction ); abstract class JetStream implements Helicopter 哪种说法是正确的? TransportVehicle ha

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1