New candidate JEP: 445: Flexible Main Methods and Anonymous Main Classes (Preview)
Glavo
zjx001202 at gmail.com
Mon Apr 10 18:25:16 UTC 2023
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/jdk-dev/attachments/20230411/58699ec3/attachment.htm>
More information about the jdk-dev
mailing list