Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
138 views
in Technique[技术] by (71.8m points)

java - Maintaining global but changeable variables across classes/packages

I want to maintain some global variables that can be changed in Java. And once the state/value of a variable changes, next time I use this variable I should have the new changed state/value.

For example I use a config property and once changed, the new value should be used thereafter.

I am not able to figure out how to achieve this in Java. Any suggestions would be very helpful.

question from:https://stackoverflow.com/questions/65899285/maintaining-global-but-changeable-variables-across-classes-packages

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...