wood burning stoves*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes anonymous inner class and enum contants Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "anonymous inner class and enum contants" Watch "anonymous inner class and enum contants" New topic
Author

anonymous inner class and enum contants

Raju Champaklal
Ranch Hand

Joined: Dec 10, 2009
Posts: 521
i was thinking that can an enum contant declare a new method in its anonymous block which wasnt already there in the enum?

and does an anoymous class declare a new method that wasnt there in the superclass....

i think we can declare new methods but we can call them...am i right? just checking if my concept was right


scjp 1.6 91%, preparing for scmad
"Time to get MAD now.. we will get even later"....by someone unknown
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9280
    
  17

Raju Champaklal wrote:i think we can declare new methods but we can call them...am i right?

We can declare then but we cannot call them. The easiest way to find out is generally to try such a thing, and then you can confirm here...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Raju Champaklal
Ranch Hand

Joined: Dec 10, 2009
Posts: 521
oh yes....actually that was a can't and not a can....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: anonymous inner class and enum contants
 
Similar Threads
Understanding enum
Understanding enum bodies
enum within a method?
Name of enum object in all lower-case
Is there a way to instantiate anonymous inner class?