maybe try enums:
package p;
interface Foo {
void bar();
}
enum State implements Foo {
Alabama, Alaska, Arizona, Arkansas, California(new Integer(42)) {
public void bar() {
System.out.print("is strange ");
super.bar();
}
},
Colorado, Connecticut, Delaware, Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana, Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, Nebraska, Nevada, NewHampshire, NewJersey, NewMexico, NewYork, NorthCarolina, NorthDakota, Ohio, Oklahoma, Oregon, Pennsylvania, RhodeIsland, SouthCarolina, SouthDakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, WestVirginia, Wisconsin, Wyoming;
State() {
this(null);
}
State(Object object) {
this.object = object;
}
public void bar() {
System.out.println(this + " " + object);
}
public static void main(String[] arguments) {
for (State state : State.values())
state.bar();
}
final Object object;
}