Java Inheritance & Polymorphism Quiz

Java Inheritance & Polymorphism Quiz

University

25 Qs

quiz-placeholder

Similar activities

Advanced Java MCQs

Advanced Java MCQs

University

20 Qs

Understanding Java Inheritance Concepts

Understanding Java Inheritance Concepts

University

20 Qs

Software Testing in Java

Software Testing in Java

1st Grade - University

25 Qs

Java File I/O Quiz

Java File I/O Quiz

University

20 Qs

IT AppDev 1 Pre-Midterm-Quiz

IT AppDev 1 Pre-Midterm-Quiz

University

25 Qs

JavaScript Lesson 1

JavaScript Lesson 1

11th Grade - University

20 Qs

Java Quiz in tamil theme by jamal

Java Quiz in tamil theme by jamal

University

25 Qs

Mastering Core Java Concepts

Mastering Core Java Concepts

University

20 Qs

Java Inheritance & Polymorphism Quiz

Java Inheritance & Polymorphism Quiz

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?