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 代碼
刪除
恢復自動保存:
?