Closed dwang733 closed 7 years ago
Is it possible? Yes, by making your own array. I imagine changing this in the framework isn't very high on the devs' todo list though.
public class RobotTypes {
public static final RobotType[] SORTED = {
RobotType.ARCHON,
RobotType.GARDENER,
RobotType.LUMBERJACK,
RobotType.SCOUT,
RobotType.SOLDIER,
RobotType.TANK
};
}
// Somewhere else
for (RobotType c : RobotTypes.SORTED)
System.out.println(c);
If you run this code
you get
Is it possible to make the values print out in alphabetical order instead?