Header files don't exist in Java.  

Common elements are put in interfaces, (which are .java files), and all other class properties are defined as public, protected, and private.  Circular dependencies between .java files are automatically handled by the compiler, removing the need for header files at all in the Java language.

The equivalent of a header file definition in Java would be a public static final variable in class.

The use of header files to modify source code before compilation or to change the meaning of the C++ language (through #define substitution) is not supported in Java.  This is a good thing since #define was often heavily abused.

blog comments powered by Disqus