Java Inheritance & Polymorphism Quiz

Java Inheritance & Polymorphism Quiz

University

25 Qs

quiz-placeholder

Similar activities

Quiz Diagram Kelas

Quiz Diagram Kelas

11th Grade - University

20 Qs

Exploring Python and Data Science

Exploring Python and Data Science

University

20 Qs

Seatwork #4

Seatwork #4

12th Grade - University

25 Qs

PHP OOP Quiz

PHP OOP Quiz

University

20 Qs

Advanced Java Concepts Assessment

Advanced Java Concepts Assessment

University

20 Qs

LogoNOVA (FYIT Logo Quiz)

LogoNOVA (FYIT Logo Quiz)

University

20 Qs

Understanding Python Classes and Objects

Understanding Python Classes and Objects

University

20 Qs

PPL (QUIZ 6) Memory Management Quiz

PPL (QUIZ 6) Memory Management Quiz

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?

Discover more resources for Information Technology (IT)