"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
Java-Control Statements Part 1

Quiz
•
9th - 12th Grade
20 questions
Chapter 2 Exam: Getting Started with Java

Quiz
•
10th - 12th Grade
20 questions
Introduction to JavaScript

Quiz
•
9th - 12th Grade
13 questions
Intro to IF statements

Quiz
•
KG - University
15 questions
JavaScript

Quiz
•
9th Grade
20 questions
Computer Science: Chapter 2 Test Review

Quiz
•
9th - 12th Grade
14 questions
JAVA QUIZ

Quiz
•
9th Grade
19 questions
Java Basic 1 - Quiz

Quiz
•
8th Grade - University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

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

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade