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

Glavo zjx001202 at gmail.com
Mon Apr 10 18:34:12 UTC 2023


---------- Forwarded message ---------
From: Glavo <zjx001202 at gmail.com>
Date: Tue, Apr 11, 2023 at 2:25 AM
Subject: Re: New candidate JEP: 445: Flexible Main Methods and Anonymous
Main Classes (Preview)
To: amber-dev at openjdk.org <amber-dev at openjdk.org>
Cc: Ron Pressler <ron.pressler at oracle.com>, amber-dev at openjdk.org <
amber-dev at openjdk.org>, jdk-dev at openjdk.org <jdk-dev at openjdk.org>


I like some parts of this proposal, but I disagree with it. I think this
proposal is too narrow and limits its usefulness.

Is the implicit public and static modifiers strange? The interface has
worked this way for many years, why is it not acceptable here?

Personally, I'd prefer not to allow instance methods to be main methods,
and implicitly treat top-level variable and method declarations as static
and public -- just like interfaces do.
I think this could be a step towards package-level declarations, whereas
the current proposal limits the direction it can go.

On Tue, Apr 11, 2023 at 1:37 AM Mark Reinhold <mark.reinhold at oracle.com>
wrote:

> https://openjdk.org/jeps/445
>
>   Summary: Evolve the Java language so that students can write their
>   first programs without needing to understand language features designed
>   for large programs. Far from using a separate dialect of Java, students
>   can write streamlined declarations for single-class programs and then
>   seamlessly expand their programs to use more advanced features as their
>   skills grow. This is a preview language feature.
>
> - Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230411/6e065e3d/attachment.htm>


More information about the amber-dev mailing list