<div dir="ltr"><div dir="ltr">Hello!<div><br></div><div>Thank you for the answer</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 17, 2024 at 2:06 AM Alex Buckley <<a href="mailto:alex.buckley@oracle.com">alex.buckley@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
This is technically true, but it's missing the forest for the trees. The <br>
compilation unit that contains your implicitly declared class *already* <br>
has `import module java.base` at the top, per JEP 477. (And java.base is <br>
certainly in the default set of root modules for the unnamed module.) I <br>
think the trouble with <a href="http://java.se" rel="noreferrer" target="_blank">java.se</a> has led javac to forget that java.base <br>
(and hence ArrayList) is imported.<br></blockquote><div><br></div><div>In my sample, implicit class is not used. I think, at some point, beginners move away from implicit classes, </div><div>and the question still remains, whether it's a reasonable idea to use `import module <a href="http://java.se">java.se</a>`, or not.</div><div>I find it strange that to import the whole Java SE API, one need to add two explicit imports (<a href="http://java.se">java.se</a> and java.base) </div><div>when not using implicit class.</div><div> </div><div>With best regards,</div><div>Tagir Valeev</div></div></div>