i would recommend to define exactly what staments should be executed: switch (variable){ case A: statement_1(); statement_3(); break; case B: statement_2(); ... ... <看更多>
Your compiler can warn you (I think; not sure about Java) about that, but only if you did not put a default case. Alternatively, you could print a warning in ... ... <看更多>