JAVA control Structure

JAVA control Structure

Professional Development

12 Qs

quiz-placeholder

Similar activities

Java Lesson 2

Java Lesson 2

KG - Professional Development

7 Qs

WRITTEN TEST - TSERIES CERTIFICATION 19 Dec 24

WRITTEN TEST - TSERIES CERTIFICATION 19 Dec 24

Professional Development

10 Qs

De todo

De todo

1st Grade - Professional Development

16 Qs

Ultrasonic

Ultrasonic

Professional Development

15 Qs

java 15-10-2023

java 15-10-2023

Professional Development

10 Qs

PRE TEST - Training Call Center 13 Sept 25

PRE TEST - Training Call Center 13 Sept 25

Professional Development

15 Qs

COP December 2021

COP December 2021

Professional Development

12 Qs

Java SE: Programming I

Java SE: Programming I

Professional Development

10 Qs

JAVA control Structure

JAVA control Structure

Assessment

Quiz

Computers

Professional Development

Medium

Created by

Dr Manishankar S

Used 32+ times

FREE Resource

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a selection statement in Java?

for

switch

while

do-while

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? int x = 5; if (x > 2) System.out.println("A"); else System.out.println("B"); System.out.println("C");

A C

B C

A

C

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop executes at least once, regardless of the condition?

while

for

do-while

switch

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The statement continue; inside a loop:

Terminates the loop immediately

Skips the rest of the loop body and jumps to the next iteration

Exits the program

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? for (int i = 1; i <= 3; i++) { if (i == 2) break; System.out.print(i + " "); }

1 2 3

1

1 2

2 3

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the correct way to read an integer from console using Scanner?

int x = Scanner.nextInt();

Scanner sc = new Scanner(System.in); int x = sc.nextInt();

sc.nextInt(); Scanner sc = new Scanner(System.in);

None of these

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Java, System.out.println() is used to:

Read data from console

Print data to console followed by a newline

Print data without newline

None of the above

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?