Java Programming Multiple Choice Questions - Loops

This section focuses on the "Loops" in Java programming. These Multiple Choice Questions (MCQ) should be practiced to improve the Java programming skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements and other competitive examinations.

1. A __________ statement allows us to execute a statement or group of statements multiple times.

A. array
B. loop
C. function
D. exception

View Answer


2. A __________ loop statement in Java programming language repeatedly executes a target statement as long as a given condition is true.

A. for
B. do-while
C. while
D. None of the above

View Answer


3. Which loop guaranteed to execute at least one time?

A. for
B. do-while
C. while
D. All of the above

View Answer


4. A for loop is useful when you know how many times a task is to be repeated.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


5. Which statement causes the loop to immediately jump to the next iteration of the loop?

A. Exit
B. Break
C. Jump
D. Continue

View Answer


6. What is the syntax of a continue is a single statement inside any loop?

A. Jump
B. Continue
C. Con
D. State-Continue

View Answer


7. Choose a valid loop name in Java below.

A. For
B. While
C. Do-while
D. All of the above

View Answer


8. A BREAK statement inside a Loop like WHILE, FOR, DO WHILE and Enhanced-FOR causes the program execution ___ Loop

A. Exit
B. Continuation with next iteration
C. Never exit
D. Can not say

View Answer


9. An enhanced FOR loop work with only Collection type data. Examples of Collection are ___.

A. Array Class type or any regular array variable
B. ArrayList
C. HashMap, HashSet
D. All of the above

View Answer


10. Break statement can be used to terminate a case in the switch statement?

A. Yes
B. No
C. Can be yes or no
D. Can not say

View Answer





Discussion



* You must be logged in to add comment.