Worked example
enum Planet {
EARTH(9.8), MARS(3.7); // each constant passes a value to the constructor
private double gravity;
Planet(double gravity) { this.gravity = gravity; }
public double getGravity() { return gravity; }
}
System.out.println(Planet.EARTH.getGravity()); // 9.8
System.out.println(Planet.MARS.getGravity()); // 3.7
The constructor runs once per constant, storing that constant's data.