Java examples for Language Basics:enum
Enum Type as a Nested Enum Type Inside a Class
public class Main { public static void main(String[] args) { Person.Gender m = Person.Gender.MALE; Person.Gender f = Person.Gender.FEMALE; System.out.println(m);//from www. j a v a 2 s. c o m System.out.println(f); } } class Person { public enum Gender { MALE, FEMALE } }