Import Question regarding modules
Kenneth Fogel
kfogel at dawsoncollege.qc.ca
Thu Feb 6 16:33:34 UTC 2025
In preparing for a class tonight that will use the traditional class notation and not the compact (classless), I performed a simple experiment. I had a program that had:
import java.util.Scanner;
The final jar size was 6K.
I replace that import with:
import module java.base;
As expected, the jar for this version was the same size.
Knowing what to import has always been a pain point usually left up to the IDE to figure out. Using java.base allows you to use a text editor to write code and not concern the new student to Java with imports that can quickly become overwhelming if they want to use a collection or LocalDateTime and so on.
What are your thoughts? Was this one of the reasons for modules?
Ken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20250206/b27b3f2e/attachment-0001.htm>
More information about the amber-dev
mailing list