
Inheritance Quiz
Authored by Rose Malaborbor
Education
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
5 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
1 min • 3 pts
Which of the following statements about inheritance in Java is/are true?
Inheritance allows a subclass to inherit fields and methods from its superclass.
Java supports multiple inheritance.
The keyword "extends" is used to indicate that a class is a subclass of another class.
Constructors are not inherited from the superclass.
2.
MULTIPLE CHOICE QUESTION
1 min • 3 pts
A car dealership needs a program to store information about the cars for sale. For each car, they want to keep track of the following information: number of doors (2 or 4), whether the car has air conditioning, and its average number of miles per gallon. Which of the following is the best design?
Use four unrelated classes: Car, Doors, AirConditioning, and MilesPerGallon.
Use classes: Doors, AirConditioning, and MilesPerGallon, each with a subclass Car.
Use a class Car, with fields: numDoors, hasAir, and milesPerGallon.
Use a class Car, with superclasses of Doors, AirConditioning, and MilesPerGallon.
3.
MULTIPLE CHOICE QUESTION
3 mins • 3 pts
A bookstore is working on an on-line ordering system. For each type of published material (books, movies, audio tapes) they need to track the id, title, author(s), date published, and price. Which of the following would be the best design?
Create one class PublishedMaterial with the requested fields plus type.
Create classes Book, Movie, and AudioTape with the requested fields.
Create one class BookStore with the requested fields plus type.
Create the class PublishedMaterial with child classes of Book, Movie, and AudioTape.
4.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
In a Multi-Level Inheritance in Java, the last subclass inherits methods and properties of ____.
Only one immediate Superclass
Few classes above it.
All classes above it
None of the choices
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
Which of the following is an example of hierarchical inheritance in Java?
A Car class that inherits from a Vehicle class, and a Truck class that inherits from the Car class.
A Circle class that inherits from a Shape class, and a Shape class that inherits from the Rectangle class.
A Person class that inherits from a Student class, and a Teacher class that inherits from the Person class.
A Dog class that inherits from an Animal class, and a Cat class that also inherits from the Animal class.
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
Teaching terminologies
Quiz
•
University
10 questions
Jigsaws
Quiz
•
University
10 questions
United Nations
Quiz
•
5th Grade - University
10 questions
Learning with movies/Coraline
Quiz
•
University
10 questions
Units & Dimensions
Quiz
•
University
7 questions
How Well Do You Know Our Leopard Cats?
Quiz
•
KG - Professional Dev...
9 questions
HUSTer! Rung chuông vàng TOEIC!
Quiz
•
University
10 questions
velykos
Quiz
•
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
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th 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