1) What keyword is used to allow a class to inherit from another class? a) implements b) extends c) inherits d) super 2) Which access modifier makes a method or variable accessible only within its own class? a) public b) protected c) private d) default 3) What is the term for the ability of an object to take on many forms (e.g., a superclass reference holding a subclass object)? a) Inheritance b) Encapsulation c) Polymorphism d) Abstraction 4) A class that is declared with the abstract keyword: a) Can be instantiated directly. b) Cannot be instantiated directly. c) Can only have abstract methods. d) Cannot have a constructor. 5) What keyword is used for a class to use an interface? a) extends b) uses c) realizes d) implements 6) When a subclass provides a specific implementation for a method that is already defined in its superclass, it is called: a) Method Overloading b) Method Overriding c) Method Hiding d) Method Abstracting 7) Can a single class in Java extend more than one class (multiple inheritance)? a) Yes b) No 8) Can a single class in Java implements more than one interface? a) Yes b) No 9) Which modifier makes a member accessible to its package and all its subclasses (even in other packages)? a) public b) protected c) private d) default (package-private) 10) An interface can contain: a) Only abstract methods. b) Only concrete methods. c) Abstract methods, default methods, and static methods. d) Only constructors. 11) What is the main purpose of an abstract class? a) To be instantiated many times. b) To serve as a base class (superclass) for other classes to extend. c) To hide all data. d) To replace interfaces. 12) The default access modifier (when no modifier is written) means the member is accessible: a) Only within the same class. b) Only within the same package. c) Everywhere in the project. d) Only to subclasses.
0%
Answer the multiple-choice questions about Java Object-Oriented Programming concepts
共享
共享
共享
由
Joaobittencourt
Ensino técnico
Ensino superior
Dados e programação
编辑内容
打印
嵌入
更多
作业
排行榜
显示更多
显示更少
此排行榜当前是私人享有。单击
,共享
使其公开。
资源所有者已禁用此排行榜。
此排行榜被禁用,因为您的选择与资源所有者不同。
还原选项
随堂测验
是一个开放式模板。它不会为排行榜生成分数。
需要登录
视觉风格
字体
需要订阅
选项
切换模板
显示所有
播放活动时将显示更多格式。
打开成绩
复制链接
QR 代码
删除
恢复自动保存:
?