
Java Inheritance Quiz
Authored by Wayground Content
Computers
11th Grade
Used 16+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet if `class B extends A` and both classes have a method `display()` that prints "A" in class A and "B" in class B, and method `display()` of class B calls `super.display()`? ```java B obj = new B(); obj.display(); ```
A
B
AB
BA
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What access modifier should be used for a superclass method to ensure that it can be overridden by any subclass in any package?
private
protected
public
default
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which principle of Object-Oriented Programming is demonstrated by method overriding?
Encapsulation
Inheritance
Polymorphism
Abstraction
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct way to call a superclass method from a subclass in Java?
super.methodName();
this.methodName();
superclass.methodName();
methodName();
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Java, which keyword is used to refer to the parent class of a class?
parent
super
this
base
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is method overriding in Java?
Changing the value of a method's parameters in the subclass.
Providing a specific implementation of a method that is already provided by its superclass.
Removing a method from the superclass in the subclass.
Calling a method from the superclass in the subclass.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What keyword is used to inherit a class in Java?
extends
implements
inherits
uses
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
J808 LO1 and LO2 planning project keywords / terms
Quiz
•
9th - 11th Grade
11 questions
CompTIA A+February27
Quiz
•
11th Grade
10 questions
Recursion Practice, Recursion Practice, Recursion Practice...
Quiz
•
10th Grade - University
10 questions
INTERNET AND INTRANET
Quiz
•
9th - 11th Grade
10 questions
Social media influencers
Quiz
•
6th - 12th Grade
10 questions
1.1 - System Architecture - CPU [OCR] [GCSE]
Quiz
•
9th - 12th Grade
10 questions
CALL: Causative Verb
Quiz
•
10th - 11th Grade
12 questions
ICT Computer Basics pt1
Quiz
•
10th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade