logoalt Hacker News

pronlast Sunday at 2:34 PM3 repliesview on HN

Nice, but as of JDK 25 (the preview JEP 445 has become the permanent JEP 512), the canonical Hello World in Java is:

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

Replies

saagarjhalast Monday at 4:45 AM

Since it seems like you work on Java, would you mind taking a look at https://bugs.java.com/bugdatabase/view_bug?bug_id=JDK-836673..., where this syntax does not work for shebangs?

prmoustachelast Sunday at 7:02 PM

Not a java developer but why the void? Shouldn't your main function and program return an integer?

show 2 replies
troymclast Sunday at 3:00 PM

Thanks, I made a note to update that someday.