File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

anonymous inner class and enum contants

 
Raju Champaklal
Ranch Hand
Posts: 521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ankit Garg
Sheriff
Posts: 9496
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Raju Champaklal
Ranch Hand
Posts: 521
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh yes....actually that was a can't and not a can....
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic