What is the difference between an if statement and a switch statement?
Answer:
-The if statement is used to select among two alternatives.
-It uses a boolean expression to decide which alternative should be executed.
-The switch statement is used to select among multiple alternatives.
-It uses an int expression to determine which alternative should be executed
Share To Friends Via:
More Questions For Programming in Java:
What is Java? (Answered) What is Java? . Posted On:Sat 20, March 2021 20:03:42 pm