Java subclass not importing import from abstract superclass?

I have an abstract class that extends with many other classes.

They need to import about 7 packages, but when I import them into an abstract class, not subclasses, compiler errors. Is it not possible, or am I just not doing it right? thank!

+3
source share
1 answer

Imports are not automatically added to subclasses.

Import simply allows the programmer to use a shorter name for the type (e.g. List<T>), rather than the type full name ( java.util.List<T>), This has nothing to do with inheritance.

IDE, Eclipse, - IDE. ( ! @# $, ).

+14

All Articles