Control Statements in JAVA

Control Statements in JAVA

University

10 Qs

quiz-placeholder

Similar activities

Code Craft : Java & Web Quiz"

Code Craft : Java & Web Quiz"

University

15 Qs

CMP128 Java Ch. 05 Methods

CMP128 Java Ch. 05 Methods

University

10 Qs

Java Quiz 3

Java Quiz 3

University

15 Qs

JAVA - Arrays

JAVA - Arrays

University - Professional Development

15 Qs

Briefing Operator Java

Briefing Operator Java

University

10 Qs

Bootcamp Day 3 - Java Array

Bootcamp Day 3 - Java Array

University

15 Qs

Java Quiz 1

Java Quiz 1

University

10 Qs

Teks dan Desktop Berbasis Objek

Teks dan Desktop Berbasis Objek

University

10 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?