Two enums have some elements in common, why does this produce an error?

Enum names are in global scope, they need to be unique. Remember that you don’t need to qualify the enum symbols with the enum name, you do just:

Month xmas = December;

not:

Month xmas = Month.December;  /* This is not C. */

For this reason, you often see people prefixing the symbol names with the enum’s name:

enum Month { Month_January, Month_February, /* and so on */ };

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)