Microsoft Java is a one-liner these days.
$ cat program.cs Console.WriteLine("Hello, World!"); $ dotnet run Hello, World!
Comment on Anon tries programming in Java
JackbyDev@programming.dev 12 hours agoThis is getting a little better nowadays.
> cat Hello.java void main() { System.out.println("Hello, World!"); } > java --enable-preview Hello.java Hello, World!
Things to notice:
public static
String[] args
.This still uses preview features though. However, like you demonstrated already, compilation is no longer a required step for simplistic programs like this.
Microsoft Java is a one-liner these days.
$ cat program.cs Console.WriteLine("Hello, World!"); $ dotnet run Hello, World!
PanArab@lemm.ee 4 hours ago
It must be somewhere under the hood. Otherwise, it wont be callable and it would require an instance of an object to call. Unless the object here is the Java environment?
They are just optional I’m sure, like C and C++. You still need them to read command line arguments.