Java Switch Statement
You can do this:
switch (variable){
case A: do statement_1; do statement_3; break;
case B: do statement_2; do statement_3; break;
}
i would recommend to define exactly what staments should be executed:
switch (variable){
case A:
statement_1();
statement_3();
break;
case B:
statement_2();
statement_3();
break;
}
for Update-3:
create methods for those 10 lines:
public void statement_1() {
//your 10 lines of code
}
if you're always executing statement_3, except for case C you can go with if/else-blocks as you wrote them.
but in my honest opinion: define EXACTLY what has to be done in which case if you have a small amount of cases. it is easier to read for others