Hi Barry, Ofcourse i compiled and run the program....!
Ok let me put it straight forward.
The answer for this is given as
It is a account type It is a account type It is a account type FIXED
I dont understand why the constructor is being called three times here.
Can any one suggest?
Joined: Aug 03, 2002
We have cases where people do not try to compile code and run it, so it's always best to ask.
So it looks as if the values of the enum are actually instances of a class, and what you are seeing is the constructor being invoked for each of the three instances. If you take a look at Sun's tutorial on Enums you will see a more interesting example where you can actually pass arguments to the constructor, and add methods to the Enum values.
Here's the Enum tutorial [ May 30, 2007: Message edited by: Barry Gaunt ]