Finalising the on-ramp feature
Ethan McCue
ethan at mccue.dev
Wed Jan 22 17:48:47 UTC 2025
You will need an import when you make the transition from an unnamed to a
named class if you have anything coming from java.base that is not also in
java.lang. The difference is that now the only import you need is import
module java.base;, not also import static java.io.IO.*;
On Wed, Jan 22, 2025 at 12:27 PM Kenneth Fogel <kfogel at dawsoncollege.qc.ca>
wrote:
> I'm puzzled. Will I need any imports if what I want comes from java.base
> in the compact format?
>
> The statement that now requiring "IO." before the input/output statements
> will make the transition from compact to api easier is, for me, false. It
> is just one more item in those first classes where we must tell our
> students not to worry themselves over the dot notation. It will eventually
> make sense.
>
> I'd like to see a poll of instructors asking which methods should have a
> default static import. As already mentioned, I'd like to see pow rather
> than Math.pow. I'd take it even further and suggest that the entire Math
> library should have default static imports. Make it a feature you can turn
> on or off when using java.exe to compile and execute. No need to tell me
> why this won't work in an API world, I can see why, but it will work in a
> compact world. This is a world exclusively for teaching the language. No
> one is likely to develop an application for distribution using compact
> syntax. It is a stepping stone.
>
> Ken
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20250122/a62bf00b/attachment-0001.htm>
More information about the amber-dev
mailing list