Zebra0.com

java switchswitch: looking at one variable

switch: looking at one variable

In this example, we calculate the tip as 20% if the service is 'Y' or 'y'. Otherwise, the tip is 15%Compare this to the example using if/else.