"switch" Java Statement - 1

"switch" Java Statement - 1

9th - 10th Grade

17 Qs

quiz-placeholder

Similar activities

Ինֆորմատիկա 10 II   կիսամյակի  ամփոփիչ աշխատանք

Ինֆորմատիկա 10 II կիսամյակի ամփոփիչ աշխատանք

10th - 12th Grade

20 Qs

Software: Programming Languages

Software: Programming Languages

10th - 12th Grade

14 Qs

Chapter 3: Storage devices and media (Part 2):

Chapter 3: Storage devices and media (Part 2):

10th - 11th Grade

15 Qs

Q1 M 4 PRE TEST

Q1 M 4 PRE TEST

10th Grade

15 Qs

Effect of ICT

Effect of ICT

9th - 12th Grade

12 Qs

Informatika Kelas 5 Bab 2

Informatika Kelas 5 Bab 2

5th Grade - University

19 Qs

Quiz on Misinformation and Bias

Quiz on Misinformation and Bias

10th Grade - University

18 Qs

ICT Service Solutions 2

ICT Service Solutions 2

8th - 12th Grade

17 Qs

"switch" Java Statement - 1

"switch" Java Statement - 1

Assessment

Quiz

Computers

9th - 10th Grade

Practice Problem

Medium

Created by

Swarn Mishra

Used 173+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?