Skip to content

Instantly share code, notes, and snippets.

@nobeans
Created August 5, 2013 04:07
Show Gist options
  • Save nobeans/6153450 to your computer and use it in GitHub Desktop.
Save nobeans/6153450 to your computer and use it in GitHub Desktop.
enum Num {
ONE(1) {
String toRoman() { "Ⅰ" }
},
TWO(2) {
String toRoman() { "Ⅱ" }
},
THREE(3) {
String toRoman() { "Ⅲ" }
};
int num
Num(int num) {
this.num = num
}
abstract String toRoman()
}
println Num.ONE
println Num.ONE.num
println Num.ONE.toRoman()
@nobeans
Copy link
Author

nobeans commented Aug 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment