• thenextguy@lemmy.world
    cake
    link
    fedilink
    arrow-up
    7
    ·
    21 hours ago

    You mean this?

    Now Java supports top-level instance main methods and class-less compact files. That means now the following declaration is valid:

    void main() {
        System.out.println("Hello from Java 25!");
    }
    
    • Scoopta@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      11 hours ago

      I’ll be honest, I don’t get the point of this feature. It’s nice for beginners or for writing small, quick, programs…but for the overwhelming majority of all java code I don’t see it being useful

      • brian@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        7 hours ago

        the trend of serverless means that people are writing a ton more programs that are smallish single endpoint things. not that a ton of people are using java there, but that was a major motivation for c#

      • bitcrafter@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        9 hours ago

        Sure, but I think the argument in favor of this feature is that the overwhelming majority of people picking up programming for the first time tend to be beginners, so if it helps them learn the basics before having to grapple with OOP then it is worthwhile.

    • Ephera@lemmy.ml
      link
      fedilink
      English
      arrow-up
      2
      ·
      16 hours ago

      I enjoy that the monstrous System.out.println is still right below. 🙃