
Java Inheritance & Polymorphism Quiz

Quiz
•
Information Technology (IT)
•
University
•
Hard
Viswanath E
Used 1+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the purpose of inheritance in Java?
To define multiple constructors
To reuse existing code
To create new data types
To hide data from other classes
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which keyword is used for inheritance in Java?
inherit
extends
override
implements
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Can a subclass constructor directly access a private member of its superclass?
Yes, always
No, private members are not accessible
Only using super
Only in the same package
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What happens when both superclass and subclass have a field with same name?
Superclass field is accessed through superclass reference
Compilation error
Java doesn't allow field hiding
Subclass field hides superclass field
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Can we override a method that throws an exception with one that doesn't?
No
Only if both throw same exception
Only if exception is unchecked
Yes
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of these allows multiple inheritance?
Abstract classes
Interfaces
Classes
Constructors
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following is an example of polymorphism?
Method Overloading
Declaring interfaces
Using only static methods
Declaring final variables
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Quiz on Knowledge Representation in Artificial Intelligence

Quiz
•
University
20 questions
KUIS HTML

Quiz
•
11th Grade - University
20 questions
Ujian Tengah Semester Sistem Multimedia

Quiz
•
University
20 questions
PPL 223 ( QUIZ 2) Syntax and Semantics

Quiz
•
University
28 questions
WEB SYSTEM AND TECHNOLOGY MIDTERM REVIEWER

Quiz
•
University
25 questions
SAS Dasar Program Keahlian RPL Kelas X

Quiz
•
10th Grade - University
20 questions
Soal Web Pentest (2)

Quiz
•
University
20 questions
Compro2 (Midterm) File, Input, Output

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Information Technology (IT)
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University