In java,There is only one instance of static variables, and the values are shared between all threads in the same environment.But my question is When an application is deployed in a cluster ,Does the value remain same if the application is accessed and changed by different instances of the cluster ?
Or it changes and remains the same for each instance of a cluster ?
It’s the same for each instance of JVM running in cluster. There will be different instances in differenr running JVM. And, to be more precise, as there can be multimple classloaders in within the same JVM, they will each have their own instance.