Sunday, February 1, 2009

Enum tutorial - Enum examples


sun certification level java Enum tutorial with small examples



Java
Enum Examples


1. Source code enum.

2.enum inside a class.

3.Valid and invalid enum declarations .

4.enum with main method with out class.

5.Example code use enum as a switch argument.

6.Example code use enum vlaues method.

7.Source code enum constructor, variable, method.

2 comments:

JP @ java debugging tutorial said...

good example just to add Java compiler automatically generates static values () method for every enum in java. Values() method returns array of enum constants in the same order they have listed in enum and you can use values() to iterator over values of enums in java

Thanks
How to use enum keyword in java

Anonymous said...

Nice tutorial..thanks..

Post a Comment