+ 1

swich statement

please explain

30th May 2017, 4:36 PM
Anu
Anu - avatar
2 Respostas
+ 1
Elegant way of if-else if-else. Use: switch(x) { case 1: ...some code... break; case 2: ...some code... break; default: ...some code... break; } İnstead of: if (x==1) { ...some code... } else if (x==2) { ...some code... } else { ...some code... }
30th May 2017, 7:56 PM
Erol EREN
+ 1
thanx Erol EREN
31st May 2017, 3:25 AM
Anu
Anu - avatar