• ExLisperA
    link
    fedilink
    arrow-up
    5
    ·
    3 days ago

    Actually, in Java 24 it’s:

    void main() { println("Hello World"); }

    • Akagigahara@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      Oh that’s interesting. It kinda reminds me of the C# top level statements feature.

      This still creates the function main in the normal way, right?

  • bacon_pdp@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    2 days ago

    The assembly would be:

    Mov rax,1 Mov rdx, 0 Mov rsi, buffer Mov rdi, buffer.length Syscall Mov rax,57 Syscall