JHTP自测题_第九章_面向对象编程-继承(Inheritance)
来源:互联网 发布:软件交易网 编辑:程序博客网 时间:2024/05/16 10:06
9.1Fill in the blanks in each of the following statements:
a)Inheritance is a form of software reusability in which new classes acquire the members of existing classes and embellish those classes with new capabilities.
b) A superclass’spublic and protectedmembers can be accessed in the superclass declarationand insubclass declarations.
c) In a(n)is-a or inheritancerelationship, an object of a subclass can also be treated as an object of its superclass.
d) In a(n)has-a or composition relationship, a class object has references to objects of other classes as members.
e) In single inheritance, a class exists in a(n)hierarchical relationship with its subclasses.
f) A superclass’spublic members are accessible anywhere that the program has a reference to an object of that superclass or to an object of one of its subclasses.
g) When an object of a subclass is instantiated, a superclassconstructor is called implicitly or explicitly.
h) Subclass constructors can call superclass constructors via thesuper keyword.
9.2State whether each of the following istrueorfalse. If a statement isfalse, explain why.
a) Superclass constructors are not inherited by subclasses. True
b) Ahas-arelationship is implemented via inheritance. False
c) ACarclass has anis-arelationship with theSteeringWheelandBrakesclasses. False
d) When a subclass redefines a superclass method by using the same signature, the subclass is said to overload that superclass method. False
- JHTP自测题_第九章_面向对象编程-继承(Inheritance)
- JHTP小结_第九章_面向对象编程-继承(Inheritance)
- JHTP自测题_第十章_面向对象编程-多态(Polymorphism)
- JHTP自测题_第十二章_GUI组件(上篇)
- JHTP小结_第十章_面向对象编程-多态(Polymorphism)
- JHTP自测题_第十五章_文件、流和对象序列化(Files, Streams, and Object Serialization)
- JHTP自测题_第六章_深入理解方法
- JHTP自测题_第十三章_图形及Java2D
- JHTP自测题_第三章_类、对象、方法及字符串简介
- JHTP自测题_第八章_深入理解类和对象
- JHTP自测题_第七章_数组及动态数组(Array and ArrayList)
- JHTP自测题_第十一章_深入理解异常(Exception Handling)
- JHTP自测题_第十四章_字符串、字符及正则表达式(Strings, Characters and Regular Expressions)
- JHTP自测题_第四章_控制语句Part 1-赋值、++、--运算符
- JHTP自测题_第五章_控制语句Part 2-逻辑运算符
- JHTP自测题_第二章_Java应用、输入、输出及运算符简介
- 面向对象_继承
- 面向对象_继承
- RxAndroid 与OkHttpClient打造下载实例
- HDU——1045Fire Net(最大匹配)
- (OK) Android 添加 开机启动 脚本
- Thinking in C++: 第1章 继承:类型关系
- 比较ascill码表后排序
- JHTP自测题_第九章_面向对象编程-继承(Inheritance)
- Unity3D 2D入门——第3天:C# ,我继续.......
- svn命令详解
- 聊聊高并发系统限流特技-2
- iOS 25个性能优化/内存优化常用方法
- jQuery之动画介绍
- js 学习基础 随机生成表格 颜色随机
- nil,null,NsNull
- Sublime Text 3118 插件集成定制汉化方案--赵亮(碧海情天)