My question is if it's legal to use labels other then case or default in the switch construct
According to JLS 14.10, a switch label has one of these forms:
case ConstantExpression:
default:
Is ConstantExpression meaningful to you?
what happens if they are used in combination with break statement in terms of reachability
According to JLS 14.20, a statement in a switch block is reachable if:
o It bears a case or default label, or
o There is a statement preceding it in the switch block and that preceding statement can complete normally.
case 1: throw new Exception();
; //this statement is unreachable
default should be the last label in the construct
It�s okay for the default label to be anywhere in the switch block.
[ September 04, 2003: Message edited by: Marlene Miller ]