The Oops moment/2
Quiz
•
Engineering
•
University
•
Practice Problem
•
Easy
Mekha S R
Used 1+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does the new keyword do in Java?
Deletes an object
Copies an object
Creates a new object
Imports a class
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a correct way to define an enum?
enum Color = {Red, Green, Blue}
enum Color {Red, Green, Blue}
Color enum {Red, Green, Blue}
enum(Color) => Red, Green, Blue
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How do you access a private variable from outside the class?
Use public keyword
Use a getter or setter method
Make it static
Use a constructor
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which method returns a string representation of an object?
show()
print()
toString()
getInfo()
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does a constructor do in a class?
Creates variables
Destroys objects
Initializes new objects
Runs loops
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Why are getter and setter methods commonly used in Java classes?
To repeatedly execute blocks of code within loops defined in the class
To safely retrieve and modify the values of private fields while maintaining encapsulation
To automatically delete unused variables when the object is destroyed
To bypass access modifiers and make all fields globally accessible
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
enum Size { SMALL, MEDIUM, LARGE }
public class Test {
public static void main(String[] args) {
Size s = Size.LARGE;
System.out.println(s);
}
}
SMALL
Size
LARGE
null
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?
Similar Resources on Wayground
10 questions
C Programming Day-10
Quiz
•
University
15 questions
UML Diagrams Quiz
Quiz
•
University
10 questions
APP R1
Quiz
•
University
15 questions
MAIN 1 Quiz #1: Transportation Engineering
Quiz
•
University
10 questions
OOP_1
Quiz
•
University
15 questions
PEC Sample Quiz 1
Quiz
•
University
15 questions
User Story Quiz
Quiz
•
University
15 questions
Innovations in Open-Source Technology
Quiz
•
12th Grade - University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd 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
Discover more resources for Engineering
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
7 questions
Different Types of Energy
Interactive video
•
4th Grade - University
20 questions
Slopes and Slope-Intercept Form
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
7 questions
Biomolecules (Updated)
Interactive video
•
11th Grade - University
20 questions
Winter/Holiday Trivia
Quiz
•
KG - University
10 questions
WINTER WIN Time - ELA - 12/9/2025
Quiz
•
KG - University
7 questions
Human Impact on Resources
Interactive video
•
4th Grade - University
