Wednesday 1 December 2010

What is the difference between switch statement and if statement?

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.

No comments:

Post a Comment