@Test public void test() { App app = App.A; switch (app) { case A: System.out.println(1); case B: System.out.println(2); case C: System.out.println(3); break; case D: System.out.println(4); } }
public static enum App{ A,B,C,D;}复制代码
本文共 286 字,大约阅读时间需要 1 分钟。
@Test public void test() { App app = App.A; switch (app) { case A: System.out.println(1); case B: System.out.println(2); case C: System.out.println(3); break; case D: System.out.println(4); } }
public static enum App{ A,B,C,D;}复制代码
转载于:https://juejin.im/post/5c0a44e3e51d454c443fca8f