What is meant by enum?
>> Thursday, May 26, 2011
Enum:It is defined as group of named constants.
- A enum is a class ,it should be used to extend java.lang.Enum but not other classes.
- If we are taking only constants it is not necessary to put semicolons; at end of constants.
- It also contains constructors, methods.
- All constants are public static and final.
- Enum is a child class of java.lang.Enum
- So enum cannot extend another class.
- Enu can implement any n.o of interfaces.
- We can declare enum ,inside and outside of a class,but not inside the method.
- In enum constants are compulsary
0 comments:
Post a Comment