常用类一一枚举类一一定义和调用
package test; public class EnumTest { /**枚举 * */ public static void main(String[] args) { // TODO Auto-generated method stub Student stu = new Student(); stu.setName("李华"); stu.setSex(Genders.MALE); stu.setAge(24); System.out.println(stu.getSex()); } }
package test; public enum Genders { MALE,FAMALE }
posted on 2017-10-14 09:38 PoeticalJustice 阅读(399) 评论(0) 编辑 收藏 举报