This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
the doubt i have is : Since static methods cannot directly access non-static members , how are we able to directly access the enum Days in the main method , without an object of the class TestDays . Are enums inside a class not considered as instance variable ?
All the references refer to enums as a type of constant and that they are implicitly public, static and final--so when an enum is
defined within a class, you don't need to access it via a reference to the class. And you can refer to an enum defined
outside a class definition similar to how you would refer to a static entity of another class.
SCJP 88% | SCWCD 84%
Joined: Jul 04, 2009
Thanks Henry and Ken ,
Can you also suggest some material from where i can read more about enums , as of now i have the kathy and berts book.