Skip to content

Instantly share code, notes, and snippets.

@yuroyoro
Created March 10, 2010 07:13
Show Gist options
  • Save yuroyoro/327617 to your computer and use it in GitHub Desktop.
Save yuroyoro/327617 to your computer and use it in GitHub Desktop.
package sample2;
/**
* http://d.hatena.ne.jp/Aileron/20100310/1268184123 の(3)
*/
class A
{
static interface AA
{
String value();
}
enum B implements AA
{
A,
B,
C;
private B()
{
}
@Override
public String value() {
switch( this ){
case A : return "hoge";
case B : return "fuge";
case C : return "hogehoge";
default : return "";
}
}
}
/**
*
*
* @param args
*/
public static void main(final String... args)
{
System.out.println(B.A.value());
System.out.println(B.B.value());
System.out.println(B.C.value());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment