That doesn't work. You need to do:
Fruit f = new Fruit();
Fruit.SkinType st = f.new SkinType();
Fruit.SkinType.Color = st.new Color();
which is a pain in the posterior.
But another idea strikes me:
public class Fruit {
public class SkinType {
public class color {
private String color;
public Color(String c) {
color = c;
}
.
.
.
}
public static Color GREEN;
static {
GREEN = new Color("GREEN");
}
}
}
> For what its worth, you may want to consider not doing this as it
will
> severely prohibit reuse.
>
> Sincerely,
> Anthony Eden
What I want to do is (in c++ terminology) have a enumerated list that
is encapsulated inside another class.