News Ticker

Switch Statements

Contrary to if-then-else statements, a switch statement can have numerous possible paths of execution. Switches works on primitive data types such as integer as well as enumerated types and newly introduced in Java 7 switch work with Strings. The following article Switch Statements and Gotchas shows how to use switch and identifies a few gotchas that can easily trip you up.

Leave a Reply

%d bloggers like this: