"switch" Java Statement - 1

Quiz
•
Computers
•
9th - 10th Grade
•
Medium
Swarn Mishra
Used 173+ times
FREE Resource
17 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
A SWITCH case statement in Java is a ___ control statement.
Iteration
Looping
Selection
Jump
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which is the alternative to SWITCH in Java language?
break, continue
for, while
if-else
goto, exit
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What are the keywords used to implement a SWITCH case in Java language?
switch, case
default
break
All of above
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
A SWITCH statement accepts ___ type of data as input.
byte
short
int
All of above
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Choose the correct syntax of SWITCH statement in Java below.
switch(input)
{
case constant1: //statements; break;
case constant2: //statements; break;
default: //statements;
};
switch(input)
{
case constant1: //statements; break;
case constant2: //statements; break;
default: //statements;
}
switch(input)
{
case constant1: //statements; break;
case constant2: //statements; break;
default case: //statements;
};
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the output of Java program with SWITCH below?
int a=10;
switch(a)
{
case 10: System.out.println("TEN");
}
No Output
TEN
Compiler error as there is no break
None
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the output of the Java program below?
int b=20;
switch(b)
{
default: System.out.println("LION");
}
No Output
LION
Compiler error as there are no CASE statements.
None
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
UTS DASPRO

Quiz
•
1st - 10th Grade
17 questions
Unit 7 Review 1

Quiz
•
9th - 12th Grade
12 questions
Loops

Quiz
•
9th - 12th Grade
20 questions
Pemrograman Struktural

Quiz
•
9th Grade
20 questions
แบบทดสอบความรู้เบื้องต้น, ตัวแปรและชนิดข้อมูล ม.4/1

Quiz
•
9th Grade
20 questions
Video Game Trivia

Quiz
•
5th - 12th Grade
16 questions
Java Chapter 1 CS2

Quiz
•
9th - 12th Grade
12 questions
Pretest - Webinar1 Kelas Industri Hummasoft

Quiz
•
10th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade