Lev1

导航

枚举练习

package cn.meiju;

public enum Learn {
        L1,L2,L3
}
package cn.meiju;

public class Worker {
        public void choose(Learn learn) {
            switch(learn) {
            case L1:
                System.out.println("JAVA初级程序员");
                break;
            case L2:
                System.out.println("JAVA高级程序员");
                break;
            case L3:
                System.out.println("JAVA架构师");
            }
        }
        public static void main(String[] args) {
            Worker worker = new Worker();
            worker.choose(Learn.L2);
        }
}

 

 

posted on 2019-07-31 10:36  Lev1  阅读(138)  评论(0编辑  收藏  举报