4 ms·
Nothing like a short class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } } to start a nice jou
by Kototama 3y ago
Nothing like a short
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
to start a nice journey into programming, right?
- vitiral 3y agoYou forgot to declare the package name! How are you going to properly load the hello.world.example package?
- Kototama 3y agoAh ah :-) It has been so long I actually copied it from a website. But I had to look after your comment and Java can cope with no package declaration! https://stackoverflow.com/questions/2335211/what-is-the-default-package-in-which-my-classes-are-put-if-i-dont-specify-it https://stackoverflow.com/questions/2335211/what-is-the-defa...
- lenkite 3y agoDude, Java has changed. You don't need `public static void main` anymore. https://medium.com/@shwetha.hey/java-21-no-more-public-static-void-main-c90334d6d95e https://medium.com/@shwetha.hey/java-21-no-more-public-stati... Also you can do new { System.out.println("Hello, world!"); }