What is ENUM?

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


Please Help Members By Posting Answers For Below Questions

What is reference types in c#?

471


Illustrate the differences between the system.array.copyto() and system.array.clone()?

505


What are the advantages of using partial classes?

526


What is xaml file in c#?

528


Illustrate namespaces in c#?

542






Which string method is used for concatenation of two strings in c#?

467


What is predicate builder?

472


What is the difference between protected and internal in c#?

456


What is int tryparse in c#?

509


What is ControlBox Propertie

568


What is sqlcommand in c#?

493


Is c# scripting language?

499


What exactly is serverless?

420


What are anonymous functions in c#?

511


What is the base class of all classes in c#?

501