Answer Posted / javamasque
1. Enum is implicitly final subclass of java.lang.Enum.
2. if an enum is a member of a class, it is implicitly static.
3. The keyword “new” can never be used with an enum, even within the enum type itself.
4. For enum constants, “equals” and “==” is same thing, and can be used interchangeably.
5. Enum constants are implicitly public static final.
6. The enum constants are its instances.
7. Only private modifier can be used before it’s constructor.
8. Enum can implement interface but can’t extends any class
9. We can override only toString() method to return any custom string.
10. The static method values() return all enum constants in an order as it found inside enum class.
11. The instance method name() returns string value of enum constant.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is Global Assembly Cache (GAC) and what is the purpose of it? (How to make an assembly to public? Steps) How more than one version of an assembly can keep in same place?
What will be the output of the following code?
Is it possible to have different access modifiers on the get/set methods of a property?
What is datatable in c#?
Can structs in c# have destructors?
Can bool be null c#?
Which attribute adorn a test class to be picked up by the NUnit GUI in the NUnit test framework?
What is difference between property and variable in c#?
What is the purpose of the integer parse method the decimal parse method?
Explain how can I get around scope problems in a try/catch?
Why main method is static in c#?
How big is an int in c#?
What are object pooling and connection pooling and difference between them?
What are the collections in c#?
What is c# used for?