Control Statements in JAVA

Control Statements in JAVA

University

10 Qs

quiz-placeholder

Similar activities

II CSM A & B

II CSM A & B

University

15 Qs

JAVA UNIT 1 PART 2

JAVA UNIT 1 PART 2

University

15 Qs

OOP Quiz

OOP Quiz

University

10 Qs

Java Arrays

Java Arrays

University

10 Qs

Topic 4-2: Multiple if-else and switch-case

Topic 4-2: Multiple if-else and switch-case

University

10 Qs

Kuis Dadakan ;)

Kuis Dadakan ;)

10th Grade - University

15 Qs

Basics of C

Basics of C

University

10 Qs

Python-Basic

Python-Basic

3rd Grade - University

15 Qs

Control Statements in JAVA

Control Statements in JAVA

Assessment

Quiz

Computers

University

Hard

Created by

RAVIKANTH K

Used 5+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

public class ControlStatement1 {

public static void main(String[] args) {

if(true){

System.out.println("If condition true");

}

}

}

Compile time Error

Run time Error

If condition true

NONE

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

public class ControlStatement1 {

public static void main(String[] args) {

if(true){

System.out.println("If condition true");

}else{

System.out.println("Else true");

}

}

}

If condition true

Else true

Both of above

If condition true

Else true

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

int a =5, b=10;

if(a>b || a<b){

System.out.println("A greater than B OR A less than B");

}else{

System.out.println("Invalid Condition");

}

A greater than B

A less than B

A greater than B OR A less than B

Invalid Condition

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is a loop statement?

An statement, which is executed repeatedly

An statement, which is executed once

An statement, which is never executed

None of above

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

for(int i=0; i<10; i+=2){

System.out.print(i);

}

0123456789

02468

0246810

123456789

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

for( ; ; ){

System.out.print("Hello Loop");

}

Run time Error

Compile time error

Hello Loop

Infinite Loop

7.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

int[] arr = {1, 2, 3, 4}

for(int i:arr){

System.out.println(i);

}

1

2

3

4

Compilation Error

Runtime Error

None

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?