Java Inheritance & Polymorphism Quiz

Java Inheritance & Polymorphism Quiz

University

25 Qs

quiz-placeholder

Similar activities

Java Programming Fundamentals

Java Programming Fundamentals

University

20 Qs

Java Programming Fundamentals

Java Programming Fundamentals

University

20 Qs

CH 1 - Intro to Computers, Programs, & Java

CH 1 - Intro to Computers, Programs, & Java

University

22 Qs

Fundamentals of programming Quiz

Fundamentals of programming Quiz

University

25 Qs

Uji Pengetahuan Teknik Informatika

Uji Pengetahuan Teknik Informatika

12th Grade - University

20 Qs

DSA reviewer

DSA reviewer

University

26 Qs

Java Fundamentals Assessment

Java Fundamentals Assessment

University

20 Qs

Understanding Method Overloading in Java

Understanding Method Overloading in Java

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?