This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Variables inside a final class

 
Thillai Sakthi
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We know that all methods inside a final class are implicitly final. what happens to the variables (data members) declared inside this class. Will they also be considered as final? Pls clarify.
------------------
 
Thandapani Saravanan
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Final class can not be sub-classed. Data members inside a final class are not implicitly final. Try this:

 
Thillai Sakthi
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah the program what u had given works. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic