Which of these are selection statements in Java?

Java MCQ: Which of these are selection statements in Java?

a) if
b) switch
c) break
d) a and b

Answer:

d) a and b

Explanation:

The if and switch statements in Java are selection statements that allow the program to make decisions and execute specific blocks of code based on conditions.

Reference links:

https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top