• Post Reply Bookmark Topic Watch Topic
  • New Topic

Variables inside a final class  RSS feed

 
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.
------------------
 
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.
 
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
The WEB SERVICES and JAX-RS Course
https://coderanch.com/t/690789/WEB-SERVICES-JAX-RS
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!