
CAI710-M2-Q1
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Easy
Muhammad Noman
Used 2+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following best describes the “is-a” relationship in Java inheritance?
A subclass is part of a superclass.
A subclass contains a superclass.
A subclass is an extension of a superclass.
A superclass is dependent on a subclass.
A superclass cannot share attributes with its subclass.
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
In a software model, a 'Professor' class inherits from a 'Person' class. Which of the following best explains why this inheritance relationship is valid?
The 'Person' class is a sub-type of 'Professor'
The 'Professor' class is a specialized object.
A 'Professor' has a 'Person'.
A 'Professor' is a type of 'Person', so it can reuse common attributes and behaviors.
Both 'Professor' and 'Person' are classes in the same system.
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
If we have the classes Car and Vehicle, and Car extends Vehicle, which statement correctly explains the relationship?
A Car is-a Vehicle.
A Vehicle is-a Car.
A Car contains a Vehicle.
A Vehicle cannot be a superclass of Car.
A Car and Vehicle are unrelated.
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
When a subclass constructor does not explicitly call a superclass constructor using super(), what action does the Java compiler automatically take?
It calls all available constructors in the superclass to ensure proper initialization.
It throws a compile-time error because the superclass constructor must be explicitly called.
It automatically calls the no-argument constructor of the superclass.
It throws a runtime error because the superclass was not initialized.
It initializes the subclass but skips the initialization of the superclass.
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
If a superclass defines only parameterized constructors and no default (no-argument) constructor, what happens when the subclass does not explicitly call super(parameters)?
The compiler automatically inserts a call to the parameterized constructor.
The compiler automatically creates a default constructor in the superclass.
Compilation error because no suitable super() is available.
The subclass constructor executes successfully without initializing superclass variables.
The JVM provides default values to superclass attributes automatically.
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
In a scenario where a `Cat` subclass has a constructor `Cat()` and its `Animal` superclass has two constructors: `Animal()` and `Animal(String breed)`, what happens if `Cat()` does not explicitly call `super()`?
A compile-time error will occur.
The program will crash at runtime due to an unhandled exception.
The `Animal(String breed)` constructor will be called automatically.
The `Animal()` constructor will be called automatically.
The subclass constructor will run, but the superclass will not be initialized.
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What does method overriding mean in Java?
Writing multiple methods with the same name but different parameter lists in the same class.
Defining a method in a subclass with the same signature as a method in the superclass.
Preventing a subclass from accessing superclass methods.
Using a constructor in the subclass instead of the superclass method.
Changing the return type of a method in the subclass.
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
14 questions
Input, output and storage de
Quiz
•
8th Grade - Professio...
14 questions
Topologías de red!
Quiz
•
12th Grade
10 questions
ZOOM QUIZ
Quiz
•
1st - 12th Grade
10 questions
1ª Recuperação - 3° Trim. - Pensamento Computacional - 9º ano
Quiz
•
9th Grade - University
18 questions
TEST Bài 1_K12_Sách KNTT
Quiz
•
12th Grade
10 questions
Cos’è la ROM?
Quiz
•
6th - 12th Grade
10 questions
EMPTECH L4 Q3
Quiz
•
12th Grade
10 questions
Microcontroller
Quiz
•
11th Grade - University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
55 questions
CHS Holiday Trivia
Quiz
•
12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade
