
Mastering Java Keywords
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Govindharaj I
Used 1+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the four access modifiers in Java?
static, final, synchronized, transient
public, private, static, volatile
public, private, protected, default
private, protected, synchronized, transient
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the difference between public and private access modifiers.
Public members can only be accessed within the class and its subclasses.
Public members are hidden from other classes and can only be accessed by the class itself.
Public members are accessible from anywhere, while private members are only accessible within the class they are declared.
Private members are accessible from anywhere in the program.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the protected access modifier?
To make class members accessible only to the package they belong to.
To allow access to class members from any other class.
To restrict access to class members to the class itself and its subclasses.
To enable access to class members from any subclass regardless of the package.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you create a for loop in Java?
for(int i = 0; i < 10; i++) { print(i); }
for(int i = 0; i < 10; i++) { System.out.println(i); }
for(i = 0; i < 10; i++) { System.out.println(i); }
for(int i = 0; i < 10; i++) System.out.println(i);
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax for a while loop in Java?
while (condition) { // code to be executed }
while (condition) { code to be executed }
while (condition) // code to be executed }
while { condition } // code to be executed
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Describe the do-while loop and its use case.
The do-while loop is used when the code needs to be executed at least once, regardless of whether the condition is true or false.
The do-while loop executes only if the condition is true.
The do-while loop is used for iterating over arrays.
The do-while loop cannot execute any code if the condition is false.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main purpose of a class in Java?
To execute code directly without a main method.
To store data in a static format only.
To manage memory allocation for primitive types.
The main purpose of a class in Java is to define a blueprint for creating objects.
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
15 questions
1.1 Computer Systems Essential Knowledge
Quiz
•
9th - 12th Grade
12 questions
ICT Computer Basics pt1
Quiz
•
10th - 12th Grade
12 questions
website design elements
Quiz
•
12th Grade
10 questions
ICT as Social Change
Quiz
•
12th Grade
20 questions
Computer parts
Quiz
•
1st - 12th Grade
10 questions
การสร้างสื่อดิจิตอล Quiz
Quiz
•
9th - 12th Grade
11 questions
Packet Switching and Encryption
Quiz
•
10th - 12th Grade
10 questions
HTML & Google Site Seatwork
Quiz
•
12th Grade
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 Computers
15 questions
Internet Vocabulary Notebook Check #2 - CTEA(2024)
Quiz
•
12th Grade
11 questions
Internet Terms Vocabulary- Notebook Check #1- CTEA
Quiz
•
12th Grade
50 questions
Money Matters Fall 2025 Final Exam — Worksheet Questions
Quiz
•
12th Grade
47 questions
CSF Final Exam Practice
Quiz
•
9th - 12th Grade
