Is loading only the needed classes directly a good way of reducing the overall memory usage of a Java application?
For example:
import java.awt.Graphics;
vs
import java.awt.*;
No. You should import only the needed classes to make it clear to programmers which classes are actually needed by your class.
Import statements just tell the compiler where to look for the classes you are using - it doesn't mean all the classes in the package are loaded into memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With