Suppose I have a superclass which imports java.io.Exception as an example. If I’m handling an exception in a subclass, do I need to reimport java.io.Exception into the code for the subclass?
Suppose I have a superclass which imports java.io.Exception as an example. If I’m handling
Share
Yes (unless the two classes are in the same file).
Imports are per source code file, not per class. They are a completely compiler-only thing, with no effect at run-time.