PROGRAMING
Instead of writing many if else conditions switch statement could be easily for reduce program execution time.
switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}
In the switch reserve word expression value should be define.
If any case value match with switch value. Then execution will be stop for switch statement and program execution will be start to next line.
For example 10 if else statement for similar flow. Once execution start and match found there is less chance stop execution.
Read what excites, achieves and moves us Read what excites, achieves and moves us