We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
21828, 1143 AM 6-De02021.pn9
Under
ing switch case statement:
1) Unlike itese switch will have multiple possible executions
2) stch will accept only byte, short, int and char datatypes up to java 14
5) From java 1-8v onwards switch started accepting thelr espective WRAPPER classes aso,Only 4)
4) From java 1.7v onward site started accepting String also
5) In swieth ther is no chance of writing duplicate ease lables
{9} the key value is matching withthe the ase label value then that case label will executed
7) Ifwe are not writing the break statement from which case label got rigerred from that case onwards all
the cases will be executed
8) All he eases, inching default ease and break statement ae optional in switch,
9) Inswiteh there should not be any INDIVIDUAL. statements.
10) In switch Key and ease Inbles datatypes should be compatable.
11) Case lable value should he within the range ofthe key datatype
12) Expressions ae allowed in sich
13) We ean write default case anywhere inside the switch, It will be getting executed oly ifno case label
‘got matched with the key value
14) Every case abe should be COMPILE TIME CONSTANT.
hitpsiclassroom google. com/ufleiNDISODAOMDYSNZY3
Syntax of switch
switeh(Key)
case lable:
w