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
แก้ไขเนื้อหา
สั่งพิมพ์
ฝัง
เพิ่มเติม
กำหนด
ลีดเดอร์บอร์ด
แสดงเพิ่มขึ้น
แสดงน้อยลง
ลีดเดอร์บอร์ดนี้ตอนนี้เป็นส่วนตัว คลิก
แชร์
เพื่อทำให้เป็นสาธารณะ
ลีดเดอร์บอร์ดนี้ถูกปิดใช้งานโดยเจ้าของทรัพยากร
ลีดเดอร์บอร์ดนี้ถูกปิดใช้งานเนื่องจากตัวเลือกของคุณแตกต่างสำหรับเจ้าของทรัพยากร
แปลงกลับตัวเลือก
แบบทดสอบ
เป็นแม่แบบแบบเปิดที่ไม่ได้สร้างคะแนนสำหรับลีดเดอร์บอร์ด
ต้องลงชื่อเข้าใช้
สไตล์ภาพ
แบบ อักษร
ต้องสมัครสมาชิก
ตัวเลือก
สลับแม่แบบ
แสดงทั้งหมด
รูปแบบเพิ่มเติมจะปรากฏเมื่อคุณเล่นกิจกรรม
เปิดผลลัพธ์
คัดลอกลิงค์
คิวอาร์โค้ด
ลบ
คืนค่าการบันทึกอัตโนมัติ:
ใช่ไหม