In Java, the base class must be declared before the derived class, or at least be available to the compiler. The compiler needs to know the base class's structure to process inheritance syntax and verify that methods and fields used in the derived class are valid.