Control Statements in JAVA

Control Statements in JAVA

University

10 Qs

quiz-placeholder

Similar activities

Condicionales en Racket

Condicionales en Racket

University

10 Qs

Porcentajes

Porcentajes

University

12 Qs

L1 - Computer Networks

L1 - Computer Networks

University

13 Qs

Software Engineering :TEST 2

Software Engineering :TEST 2

University

10 Qs

ADVACOMT-Quiz No.1 (final term)

ADVACOMT-Quiz No.1 (final term)

University

15 Qs

Quis Administrasi Sistem Jaringan

Quis Administrasi Sistem Jaringan

University

15 Qs

Web-II-Loop and Function

Web-II-Loop and Function

University

10 Qs

Programming

Programming

University

12 Qs

Control Statements in JAVA

Control Statements in JAVA

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

RAVIKANTH K

Used 5+ times

FREE Resource

AI

Enhance your content in a minute

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

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

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?