Skip to content

Instantly share code, notes, and snippets.

@satoshun
Created March 10, 2013 13:38
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 satoshun/5128601 to your computer and use it in GitHub Desktop.
Save satoshun/5128601 to your computer and use it in GitHub Desktop.
import java.util.*;
class EnumPractice{
private enum singleton{
INSTANCE;
public void show(){
System.out.println("enum show");
}
}
private enum types{
A{
public void show(){
System.out.println("A!!");
}
},
B{
public void show(){
System.out.println("B!!");
}
};
abstract public void show();
}
public static void main(String[] args){
singleton.INSTANCE.show();
types.A.show();
types.B.show();
for(final types type: types.values()){
type.show();
}
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment