• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Constant File problem

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Iam using a interface which contains static constansts to be used in other classes. The problems is when I compile the classes which uses these constants , it is taking the value of the constant which is availble at compile time..later if i change the constants file the same is not reflecting until i compile the class which uses this constant file. So the very purpose of using a constant file is lost here, If i have to recompile classes which uses them even though no code has been done in individual classes. Is there anything Iam doing wrong or it is the property...If it is then is there any workaround for this. Iam exporting through VisualAge. when I see the class file it already has the value at export time itself!!!.
Is this because of the interface Iam using..should I use a static class instead of the interface ?
Thanks for your time.
 
author
Posts: 3899
10
Redhat Quarkus Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, this is the behavior I would expect. Welcome to compiler optimizations
What I would try to do is to use a class instead and use a static variable that is NOT declared as "final".
Kyle
 
reply
    Bookmark Topic Watch Topic
  • New Topic