(I do not know whether i should ask this here or not)
I want to run the same java program twice which has most of the variables static.
if i ran this twice(concurrently) will these static variables have same values or different?
As the static variables are class variables, this is confusing me.
The static values are per-class and if you run the same java program twice, then it will create two JVMs (you’ll see two java processes in the task list), which will load the class twice (once per JVM), so the static variables will not be shared.