This is a bad attitude. I had programmers using this default constructor for enums, which basically assigns the first enumeration value, while programmers really needed a typed first enumeration value. Keep in mind that some people add values ββto existing enumerations without worrying about the order, and if they put a new value at the top, you get undefined behavior in the code written like this.
eCoinType cointype = new eCoinType();
in this case equals
eCoinType cointype = eCoinType.g;
But if you change eCoinType and put something before g, you have changed the application logic.
Mybe has a utility for this (modify the application logic using the enumerations declared in different modules of the module?), But it is as complicated as the Shadows overload keyword in Visual Basic :)
source share