Java does not support global variables . Every variable is declared within a class and forms part of that class . This is one of the principal of Object Oriented programing where everything has to be part of a class and and nothing can exists outside a class . The closest thing from a global variable are instance class variables . Those variables are available within the class where they are declared and if the are declared public , can be access from other classes but they will always be part of the class where they belong.
Every class is part of a package .
A package name consists of different names separate by periods. That's the syntax you use with the import statement. The referencing and dereferencing of objects is handled for you automatically by Java. Cast object or array references into integers or vice-versa. Do pointer arithmetic.