<div dir="auto"><div>Instance main method was introduced in JEP 445, this instance main method is in principle identical to the ""top level"" main method introduced in the same JEP (it is not really top level, but an instance method of an unnamed class).<div dir="auto"><br></div><div dir="auto">Why should this issued a warning?</div><div dir="auto"><br></div><div dir="auto"><br></div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 18, 2023, 09:37 Remi Forax <<a href="mailto:forax@univ-mlv.fr">forax@univ-mlv.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
I believe this code should emit a warning when compiled given it uses an instance main method<br>
<br>
class MissingWarnings {<br>
  void main() {<br>
  }<br>
}<br>
<br>
But the command<br>
  javac --enable-preview --source 21 MissingWarnings.java<br>
does not print a warning.<br>
<br>
regards,<br>
Rémi<br>
</blockquote></div></div></div>