4
Enum
is expanded by the compiler in a class declaration in Java?
4
Enum
is expanded by the compiler in a class declaration in Java?
5
It can be understood that a Enum
is a class with special features. The compiler will always treat this type in a specific way.
switch
,toString()
automatic,So you could say yes, at least in the end it’s more or less the same thing. I don’t know if the specification says anything about how it should be done, but it’s a possible way, because I don’t know any specific instructions in bytecode of the JVM dealing with enumerations, then it has to be simulated with some other existing form and the class seems appropriate.
What do you mean expanded in this case? I understand the explanation but still do not understand what this question wants to know.
What is translated after compiling
Browser other questions tagged java classes enums compilers
You are not signed in. Login or sign up in order to post.
What do you mean by expanded?
– user28595
Did any of the answers solve your question? Do you think you can accept one of them? Check out the [tour] how to do this, if you haven’t already. You would help the community by identifying what was the best solution for you. You can accept only one of them. But you can vote on any question or answer you find useful on the entire site.
– Maniero