Which is the alternative to SWITCH in Java language?

Class 8 Switch if else

Quiz
•
Computers
•
8th Grade
•
Hard
Pratibha Sukhija
Used 1+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
break, continue
for, while
if-else
goto, exit
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the keywords used to implement a SWITCH case in Java language?
switch, case
default
break
All of above
3.
MULTIPLE CHOICE QUESTION
30 sec • 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;
};
4.
MULTIPLE CHOICE QUESTION
30 sec • 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
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the below Java program?
int persons = 45;
int random = 45;
switch(random)
{
case persons: System.out.print("CRICKET ");
default: System.out.println("RUGBY");
}
CRICKET
CRICKET RUGBY
RUGBY
Compiler error
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the output of Java program below?
int num=40;
switch(num)
{
case 5: System.out.println("FIVE"); break;
case 35+5: System.out.println("FORTY"); break;
case 20+30: System.out.println("FIFTY");
}
FIVE
FORTY
FIFTY
Error
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the output of the below Java program?
final int persons = 45;
int random = 45;
switch(random)
{
case persons: System.out.print("CRICKET ");
default: System.out.println("RUGBY");
}
CRICKET
CRICKET RUGBY
RUGBY
Compiler error
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
UTS DASPRO

Quiz
•
1st - 10th Grade
15 questions
JAVA: Level-1

Quiz
•
5th - 12th Grade
20 questions
Java Test 1

Quiz
•
8th Grade
10 questions
Estructuras Selectivas C++

Quiz
•
7th Grade - Professio...
20 questions
Evaluación intermedia once

Quiz
•
1st - 11th Grade
15 questions
JavaScript Practice Quiz

Quiz
•
8th Grade
10 questions
Wprowadzenie do C++

Quiz
•
8th Grade
10 questions
Programming in Java

Quiz
•
8th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
25 questions
SS Combined Advisory Quiz

Quiz
•
6th - 8th Grade
40 questions
Week 4 Student In Class Practice Set

Quiz
•
9th - 12th Grade
40 questions
SOL: ILE DNA Tech, Gen, Evol 2025

Quiz
•
9th - 12th Grade
20 questions
NC Universities (R2H)

Quiz
•
9th - 12th Grade
15 questions
June Review Quiz

Quiz
•
Professional Development
20 questions
Congruent and Similar Triangles

Quiz
•
8th Grade
25 questions
Triangle Inequalities

Quiz
•
10th - 12th Grade
Discover more resources for Computers
25 questions
SS Combined Advisory Quiz

Quiz
•
6th - 8th Grade
20 questions
Congruent and Similar Triangles

Quiz
•
8th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
6 questions
Earth's energy budget and the greenhouse effect

Lesson
•
6th - 8th Grade
15 questions
SMART Goals

Quiz
•
8th - 12th Grade
20 questions
Lesson: Slope and Y-intercept from a graph

Quiz
•
8th Grade