This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

anonymous inner class and enum contants

 
Raju Champaklal
Ranch Hand
Posts: 521
  • 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: 9529
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • 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
  • 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