
Control Statements in JAVA

Quiz
•
Computers
•
University
•
Hard
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
Similar Resources on Wayground
10 questions
C Program Array and strings

Quiz
•
University
15 questions
Java

Quiz
•
University
10 questions
Week 4: Recap Java Programming

Quiz
•
University
10 questions
pointers and structures

Quiz
•
University
15 questions
Python Basics Quiz 1

Quiz
•
8th Grade - University
10 questions
Third Year Placement Training Revision Test

Quiz
•
University
10 questions
Core Java Quiz

Quiz
•
University
10 questions
Methods

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University