According to this post [Global variables in Java](https://stackoverflow.com/questions/4646577/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?](https://stackoverflow.com/questions/5581234/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?