
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
21 questions
Quiz tentang App Inventor

Quiz
•
11th Grade - University
30 questions
may 25 ex n t rep

Quiz
•
10th Grade - University
20 questions
PROGRAMMING 2 MIDTERM EXAM TRUE OR FALSE (2024-25))

Quiz
•
University
20 questions
Advanced Java UNIT-2(J2EE)-Quiz-4

Quiz
•
University
20 questions
PROGRAMMING 1

Quiz
•
University
21 questions
Лекция 2. Переменные и константы. Типы данных и математические

Quiz
•
University
25 questions
Fundamentals of programming Quiz

Quiz
•
University
24 questions
12-JS-методы строк

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