<div dir="ltr">  Hi!<div><br>I am investigating a new version of  jep495<div>( <a href="https://cr.openjdk.org/~gbierman/jep495/jep495-20241101/specs/simple-source-files-instance-main-methods-jls.html#jls-12.1.3" target="_blank">https://cr.openjdk.org/~gbierman/jep495/jep495-20241101/specs/simple-source-files-instance-main-methods-jls.html#jls-12.1.3</a> )</div>and came up with such an example:<br>```java<br>public abstract class AbstractClass {<br>    public static void main() {<br>        System.out.println("Hello, World!");<br>    }<br>   <br>    public void main(String[] args) {</div><div>        System.out.println("Hello, World! no constructor, non-static, args");<br>    }<br>}<br>```<br>Right now java chooses `void main(String[] args) ` because it contains an argument, but cannot create this class, because it is abstract,<br>I have got this error: `Exception in thread "main" java.lang.InstantiationException: AbstractClass`<br>Could you help me if this is expected? I expect that `public static void main()` will be chosen.</div><div><br>I cannot find anything related to this in JEP except this one:<br>`The behavior of an implementation if there is no candidate method to invoke, or if there is no suitable constructor in the initial class when invoking an instance candidate method, is beyond the scope of this specification.', but it doesn't contain this case.<div class="gmail-yj6qo"></div><br class="gmail-Apple-interchange-newline"></div></div>