Java is Object Oriented Language. We talk about Classes and Objects in OOPS world.
The makers of Java are smart and Intelligent, they do not want any security loop holes due to global variables, so they cut this feature.
In fact they have cut many features from C and C++
If you declare a variable as public and even a class as public you will probably get a Global Variable. But such Practice is not advisable.
OR
declare your fields as Static and public. Even they will serve the purpose of Global Variables.
Hope it helps...
The makers of Java are smart and Intelligent, they do not want any security loop holes due to global variables, so they cut this feature.
In fact they have cut many features from C and C++
If you declare a variable as public and even a class as public you will probably get a Global Variable. But such Practice is not advisable.
OR
declare your fields as Static and public. Even they will serve the purpose of Global Variables.
Hope it helps...