• Post Reply Bookmark Topic Watch Topic
  • New Topic

Static  RSS feed

 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,

I have a class in java that declares only final/constant variable. This class is being used by many other classes. So will a change in the value of final/constant require recompiling all the classes that has used this final variable?

please assist!!
 
Sanjaya Sugiarto
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you must.

Better solution: all constants and other properties in a plain text or xml file. JConfig ( http://www.jconfig.org/ ) is an example.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... It depends on how you defined the constants. Try the following:


Compile and run this code. Then, change the values in Konstants, recompile only Konstants and rerun Test. Hmmm...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!