switch – case - default


  You cannot have long, floating point, or String appearing in a case statement.  The switch expression must evaluate to byte, char, short, or int only.


  You get a compiler error if the switch expression's type can’t accommodate the value from any case - meaning if it's over the type's maximum value.  i.e. This code will not compile because the byte variable b cannot go to 130:


  default and break are both always optional.


  The default code can be placed anywhere – not necessarily at the bottom of the list. 


  Switches can be nested to appear within cases. 


  Execution falls through any code not containing a break statement.  This includes falling through any break-less default case which was not placed at the bottom of all the other the cases. 


  A case can only have a literal or a static final variable. 


  You cannot have if-elses or anything reaching outside the case block.