Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can a final variable be changed at runtime

 
kaffo lekan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
i need to know if a final variable can be changed at runtime.
Yes/No , please explain more.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but only in its constructor.
For example:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic