For the piece of code below, the 10 and 98 are printed out
int i = 10;
switch(i){
default:
System.out.println(100);
case 10:
System.out.println(10);
case 98:
System.out.println(98);
}
The thing I don't understand why the code in case 98 got execution while the case is not matching to compared value 10. To me, it is not very understandable. Can someone please explain to me?
Thank you very much.