public enum Device {
ON, OFF, STANDBY;
private Device() {
System.out.println("Hello!");
}
}
public static void main(String[] args) {
Device d = Device.STANDBY;
}
Why does this code print out three times Hello! Hello! Hello! ?
How do constructors get invoked at all in an enumeration class if it is private?