According to this post Global variables in Java it describes how to define a global variables in java by using static
public class Example {
public static int a;
public static int b;
}
But at same time in other post Why are there no global variables in Java? this question contradicts . So my question is what exactly is global variable ? Do java supports global variables ?if yes ,how? if no ,why? and how java global variables(if there are any) are different from c++ global variables?