1. Please confirm how we can iterate on Enum values()through general for/while loops.
2. I'm able to use values() method on Enum though as per Javadoc Enum class do not have such method.
3. Which all operators/operations can be performed on instance of Enum.
Personal Experience: Its difficult to search the Javaranch for any existing posts as (may be) search is words based instead of search on the meaning of the group of words. Take a example of the above queries. For first query I searched was approx. 25-35 min but unable find required details.
[Prathamesh Gaddam]: I need the iterate on Enum using traditional for loop "for(; " or while loop.
Well, Color.values() returns a simple Color array. You can iterate through this the same way you would iterate through any array. Normally in JDK 5 and later that's with an enhanced for loop, but it's also possible with a traditional for loop: