Skip to content

Instantly share code, notes, and snippets.

@davialexandre
Created April 19, 2013 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davialexandre/5423671 to your computer and use it in GitHub Desktop.
Save davialexandre/5423671 to your computer and use it in GitHub Desktop.
public class EnumExample {
public static void main(String []args){
testGender(Gender.FEMALE);
testGender(Gender.MALE);
}
public static void testGender(Gender gender) {
switch(gender) {
case FEMALE:
System.out.println("Female");
break;
case MALE:
System.out.println("Male");
break;
}
}
}
enum Gender {
MALE,
FEMALE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment