Java Inheritance Flashcard
Flashcard
•
Computers
•
11th Grade
•
Practice Problem
•
Easy
Mouna Boutemine
Used 11+ times
FREE Resource
Student preview

10 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What keyword is used to inherit a class in Java?
Back
extends
2.
FLASHCARD QUESTION
Front
What is true about the superclass and subclass relationship in Java?
Back
A subclass cannot access the private members of its superclass.
3.
FLASHCARD QUESTION
Front
What is method overriding in Java?
Back
Providing a specific implementation of a method that is already provided by its superclass.
4.
FLASHCARD QUESTION
Front
Correct way to call a superclass method from a subclass in Java: super.methodName();, this.methodName();, superclass.methodName();, methodName();
Back
super.methodName();
5.
FLASHCARD QUESTION
Front
In Java, which keyword is used to refer to the parent class of a class?
Back
super
6.
FLASHCARD QUESTION
Front
Which of the following statements is true about constructors and inheritance in Java?
- A subclass inherits all the constructors of its superclass.
- A subclass must override all the constructors of its superclass.
- Constructors are not inherited.
- Only parameterless constructors are inherited.
Back
Constructors are not inherited.
7.
FLASHCARD QUESTION
Front
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();
```
Back
AB
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
10 questions
Essential Statistics Concepts
Flashcard
•
12th Grade
10 questions
Main Idea
Flashcard
•
9th - 12th Grade
9 questions
Web Design Fundamentals
Flashcard
•
12th Grade
15 questions
Long sound or Short sound o
Flashcard
•
KG
15 questions
Scientific Method
Flashcard
•
11th Grade
15 questions
Milady 14th ed. Hair Removal Flashcard
Flashcard
•
11th Grade
10 questions
Deca 91-100
Flashcard
•
10th - 12th Grade
11 questions
Solving Systems of Equations Using Elimination by Multiplication
Flashcard
•
9th Grade - University
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