New candidate JEP: 445: Flexible Main Methods and Anonymous Main Classes (Preview)

Brian Goetz brian.goetz at oracle.com
Wed Apr 12 21:01:09 UTC 2023


See “Can’t we go further?” In https://openjdk.org/projects/amber/design-notes/on-ramp



On Apr 12, 2023, at 4:47 PM, Eric Bresie <ebresie at gmail.com<mailto:ebresie at gmail.com>> wrote:

If I’m missing something sorry up front but…

Wouldn’t the simplest for beginners be just a java file with the initial expression leaving off the main all together?

Say

(1)
System.out.println(“Hello World”);

(2)  There exists the static initialization block alternatively

static {
  System.out.println(“Hello World”);
}

(3) Or even some sort of annotation or meta data file as to where to start?

(4) Or some lambda derivative like

()-> System.out.println(“Hello World”);

Eric Bresie
Ebresie at gmail.com<mailto:Ebresie at gmail.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jdk-dev/attachments/20230412/a48ebb8f/attachment.htm>


More information about the jdk-dev mailing list