
Java and OOP
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Tuned Work
Used 1+ times
FREE Resource
Student preview

12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the super() keyword in Java?
It refers to the current object
It is used to call a superclass constructor or method
It creates a superclass object
It returns the superclass type
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about Java inheritance?
A) A class can inherit from multiple classes
B) A subclass can access private members of its superclass
C) Inheritance helps avoid redundancy and promotes code reuse
D) Java supports multiple inheritance
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is polymorphism in OOP?
The ability to define methods with different signatures in the same class
The ability for a method in a subclass to override a method in its superclass
The ability to assign different objects to a reference variable of a superclass type
The ability to use the same method name in a class with different return types
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an example of encapsulation in Java?
Declaring all data members as private and providing public getter and setter methods
Using the super keyword to call a superclass method
Declaring multiple classes in a single file
Overriding a method in the subclass
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Java, what happens if you do not explicitly call a superclass constructor?
The default constructor of the superclass is called automatically.
The subclass constructor fails to compile.
No constructor is called, and the object is not created.
The JVM throws a runtime exception.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens if a subclass constructor does not explicitly call a superclass constructor in Java?
The subclass constructor will automatically call the superclass constructor
The program will throw an error
The subclass constructor must always call a superclass constructor explicitly
Java will call the this() constructor for the subclass
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main difference between method overloading and method overriding?
Overloading happens at runtime, while overriding happens at compile-time
Overloading involves different signatures, and overriding involves the same signature in both parent and subclass
Overloading is used for constructors, and overriding is used for methods
Overloading is when the parent method is hidden by the subclass method
Create a free account and access millions of resources
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?
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...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University