Specifications

Sun Services
Java™ Programming Language
Module 4, slide 21 of 31
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Switch Statements
The switch statement syntax:
switch (
<expression>
) {
case
<constant1>
:
<statement_or_block>*
[
break;
]
case
<constant2>
:
<statement_or_block>*
[
break;
]
default:
<statement_or_block>*
[
break;
]
}