Whether Result is 'public static final': What do you mean exactly? It's public, because you specified that yourself in your code. It's not static, because top-level classes (and enums) cannot be static. You can regard it as being final, because you cannot extend an enum (you cannot create a subclass using an enum as the superclass).
Aren't plain old classes with nested enum declarations better for the purposes, because having all those constructors etc. in a enum declarations make them seem like classes to me anyway.
Maybe its a very simple concept that I'm missing about Enums in Java, I only started learning it a week back.
Deepak Borania wrote:By static I meant , if I could use an enum constant like 'CORRECT' without creating an enum reference like:
Aren't plain old classes with nested enum declarations better for the purposes, because having all those constructors etc. in a enum declarations make them seem like classes to me anyway.
It is very easy to think that Java™ is an extension of C/C++. I think the fact that so much Java syntax is copied from C/C++ makes it easier to think that.Deepak Borania wrote:I always thought, coming from a C/C++ background . . .
Shiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|