Why are we using Non Modified Constructor in Enum in Java
1 answer
Assuming you mean why there is no access modifier for the constructor because
The declaration
enum
contains a constructor declaration without access modifiersprivate
.
and
It is a compile-time error if a constructor declaration is in an enum Declaration
public
orprotected
(ยง6.6).
It's superfluous to point out private
, which is why some people don't.
+12