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
9 questions
STEM 6: U2 L2 Vocab Review
Quiz
•
6th Grade - University
10 questions
Building Quantities Documentation Quiz
Quiz
•
University
10 questions
Kinetic Energy
Quiz
•
10th Grade - University
15 questions
Topic 5 - Ethics and Professionalism in Civil Eng
Quiz
•
University
12 questions
SACA 18 Introduction to Print Reading
Quiz
•
12th Grade - University
10 questions
Intro to Coding
Quiz
•
12th Grade - University
12 questions
Framework Bootstrap
Quiz
•
University
10 questions
Plagiarism
Quiz
•
10th Grade - University
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
6 questions
FOREST Self-Discipline
Lesson
•
1st - 5th Grade
7 questions
Veteran's Day
Interactive video
•
3rd Grade
20 questions
Weekly Prefix check #2
Quiz
•
4th - 7th Grade
Discover more resources for Engineering
7 questions
Different Types of Energy
Interactive video
•
4th Grade - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
25 questions
Waves-8th Grade Physical Science
Quiz
•
KG - University
41 questions
Unit 8 Key Terms
Quiz
•
11th Grade - University
10 questions
Product & Quotient Derivative Rules
Quiz
•
University
5 questions
How to Calculate Force - Newton's 2nd Law of Motion
Interactive video
•
10th Grade - University
10 questions
Dichotomous Key
Quiz
•
KG - University
