Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • 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