Author
enum methods
Jack Bento
Ranch Hand
Joined: Jun 14, 2009
Posts: 34
Hi
Please help me understand the difference between these 2 methods. How would I call them? Why is the first one enclosed in curlys?
Thanks!
Minhaj Mehmood
Ranch Hand
Joined: Jan 22, 2007
Posts: 400
are you able to compile this code?
SCJP6 96% | SCWCD5 81% | SCDJWS5 79%
Costi Ciudatu
Ranch Hand
Joined: Oct 24, 2006
Posts: 74
posted Jan 16, 2010 06:07:11
0
First, let me try to make your code compilable (and a little more relevant):
SCARY overrides the spice() method, that's why it is declared inline (in curlys).
'new' is not suitable for enums in general (not to mention that is syntactically wrong.
Minhaj Mehmood
Ranch Hand
Joined: Jan 22, 2007
Posts: 400
the above code you can compile and run successfully.
Jack Bento
Ranch Hand
Joined: Jun 14, 2009
Posts: 34
does not compile?
Jack Bento
Ranch Hand
Joined: Jun 14, 2009
Posts: 34
Sorry I get it now. The first method belongs to scary. Thanks for helping me.
Minhaj Mehmood
Ranch Hand
Joined: Jan 22, 2007
Posts: 400
Jack Bento wrote:
does not compile?
dint get you??
subject: enum methods