Created
August 5, 2013 04:07
-
-
Save nobeans/6153450 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
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://jira.codehaus.org/browse/GROOVY-4641