1.

What does fall through and default do in switch case​

Answer»

Answer:

Fall through is a situation in java programs which occurs when the loop mises out on BREAK STATEMENT between the different cases in switch case structure.

Explanation:

Now lets suppose, i change value of x to 3 , not matching any case, than its a fall through from DEFAULT case . ... Ain't COMPILER needs to match every case for 3, by that time CASE 2 will be passed, than why it goes back to default and prints hello Benjamin.



Discussion

No Comment Found