Created
March 10, 2013 13:38
-
-
Save satoshun/5128601 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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