The Oops moment/2
Quiz
•
Engineering
•
University
•
Easy
Mekha S R
Used 1+ times
FREE Resource
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
GEB Excel
Quiz
•
University
15 questions
TRICODE CHALLENGE ROUND 1
Quiz
•
University
10 questions
FUNDAMENTALS OF BIOMETRIC SECURITY Module 2
Quiz
•
University
14 questions
G-COAL VOL.1 2024
Quiz
•
University
10 questions
Decision tree learning
Quiz
•
University
15 questions
CNS Quiz
Quiz
•
University
10 questions
Quiz 01 in MECH 223
Quiz
•
University
10 questions
Nuclear Engineering Principles 8
Quiz
•
University
Popular Resources on Wayground
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
20 questions
MINERS Core Values Quiz
Quiz
•
8th Grade
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
20 questions
Multiplying and Dividing Integers
Quiz
•
7th Grade
10 questions
How to Email your Teacher
Quiz
•
Professional Development
15 questions
Order of Operations
Quiz
•
5th Grade
Discover more resources for Engineering
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
7 questions
Central Idea of Informational Text
Interactive video
•
4th Grade - University
20 questions
Physical or Chemical Change/Phases
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
39 questions
Unit 7 Key Terms
Quiz
•
11th Grade - University
7 questions
Transition Words and Phrases
Interactive video
•
4th Grade - University
18 questions
Plotting Points on the Coordinate Plane
Quiz
•
KG - University
5 questions
Declaration of Independence
Interactive video
•
4th Grade - University
