xargs: cat:因信号 13 而终止
A . permit access to the protected item by any class defined in the same package
B . permit access to the protected item by any static class
C . permit access to the protected item by any parent class
D . ensure that the class can not throw a NullPointerException
E . define abstract elements of an interface
答案:A。被保护的可见性修饰符被用来以受保护(保护)的方式控制对该项的访问。保护措施是访问仅限于当前类(如私有项目)、同一包中的类或此类的扩展类。
A . All classes must have 1 parent but may have any number of children (derived or extended) classes
B . All classes must have 1 child (derived or extended) class but may have any number of parent classes
C . All classes must have 1 parent class and may have a single child (derived or extended) class
D . All classes can have any number (0 or more) of parent classes and any number of children (derived or extended) classes
E . All classes can have either 0 or 1 parent class and any number of children (derived or extended) classes
答案:A。Java支持继承,但不支持多重继承,因此Java类可以有任意数量的子类,但只能有一个父类。此外,由于所有Java类都直接或间接从对象类继承,所以所有Java类都只有一个父类。
A . aliases
B . relatives
C . clones
D . brothers
E . siblings
答案:E。同一父母的两个孩子之间的关系被称为兄弟姐妹(兄弟会暗示性别)。克隆是同一个对象的副本,别名是同一个对象。兄弟和亲戚不被用来定义Java中类之间的关系。
A . access a parent class‘constructor(s)
B . access a parent class‘methods and instance data
C . access a child class‘constructor(s)
D . access a child class‘methods and instance data
E . none of the above
答案:E。super保留字提供了一种访问父类的方法和实例数据的机制(不管它们是否被隐藏)。此外,可以使用super访问父类的构造函数。所以正确答案是a和b的组合,这不是一个选项,所以正确答案是e。
A . is also an Abstract class
B . is a normal class
C . is an Interface
D . is a reference to an Object
E . can‘t exist you cannot instantiate an Abstract class
答案:E。你只能实例化具体的类而不是抽象的类。但是您可以扩展抽象类和接口。
A . true
B . false
答案:B。任何类都可以扩展,无论它是接口、实现接口还是两者都不是。唯一的例外是类被显式地修改为“final”,在这种情况下它不能被扩展。
A . true
B . false
答案:B。由于方法也可以声明为私有的,任何私有方法都不能被派生类访问。因此,派生类只能访问父类的受保护的公共方法和实例数据。
A . true
B . false
答案:B。接口具有普通类所具有的所有继承属性。因此,您可以创建接口继承层次结构,就像创建类继承层次结构一样。但是,您不能做的是实例化一个必须实现的接口。
代码行数(新增/累积) | 博客量(新增/累积) | 学习时间(新增/累积) | 重要成长 | |
---|---|---|---|---|
目标 | 10000行 | 30篇 | 400小时 | |
第一周 | 138/138 | 2/2 | 25/25 | 学会写和上传代码,会编简单的输出程序 |
第二周 | 88/226 | 1/3 | 30/55 | 起文件名不能太长 |
第三周 | 898/1124 | 2/5 | 35/90 | Java类里面的方法和C语言的函数很像 |
第四周 | 632/1756 | 2/7 | 30/120 | 可以用继承extends简化重复的代码 |
第五周 | 770/2526 | 2/9 | 45/165 |
20182309 2019-2020-1 《数据结构与面向对象程序设计》第5周学习总结
原文:https://www.cnblogs.com/blueflameashe/p/11629472.html