Netty,
The switch statement always looks for the matching case constants. If there is a matching case constant, then that would be the first statement that gets executed. After that the execution of switch statement falls through the labels. That is all the statements after the matching case are executed. If there is no matching case constant, then it looks for default label and all statements after default label are executed.
In first case since k=10 and there are no break statements after each case, it prints 10,20.
In second case , it prints 10,20,default since default case is after case 10.
Try the following and you would see that default is printed first.