I get a lot of use out of Java 5 enums:
enum Galaxies { MilkyWay, Andromeda, NGC4414 }
But here's a nice trick; as enum members are actually classes, you can override the member functions they contain. I find this most useful overriding toString:
enum Galaxies {
MilkyWay {
@Override
public String toString() {
return "Milky Way";
},
Andromeda,
NGC4414 {
@Override
public String toString() {
return "NGC 4414";
}
}