Editions:
why java does not global variables or functions?
All the code in Java program is encapsulated within classes therefore Java does not have global variables or functions.