
JAVA control Structure

Quiz
•
Computers
•
Professional Development
•
Medium
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
Similar Resources on Wayground
15 questions
C PROGRAMMING BASICS-QUIZ-1

Quiz
•
Professional Development
16 questions
Think it through

Quiz
•
University - Professi...
10 questions
C Code Master lvl 2 A

Quiz
•
Professional Development
10 questions
Controles de lectura 1

Quiz
•
Professional Development
11 questions
print, input, type data, variable

Quiz
•
Professional Development
10 questions
4CSO1-Q4

Quiz
•
Professional Development
10 questions
DECI - Week 2 - round

Quiz
•
Professional Development
10 questions
Prueba Diagnostica Modulo 2

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
15 questions
Fun Random Trivia

Quiz
•
Professional Development
22 questions
Anne Bradstreet 1612-1672

Quiz
•
Professional Development
18 questions
Spanish Speaking Countries and Capitals

Quiz
•
KG - Professional Dev...
14 questions
Fall Trivia

Quiz
•
11th Grade - Professi...
15 questions
Disney Characters Quiz

Quiz
•
Professional Development
15 questions
Quiz to Highlight Q types & other great features in Wayground

Quiz
•
Professional Development