I just wrote a simple hello world class called Hello:
public class Hello {
public static void main(String[] args) {
System.out.println("Hello world");
}
}
The "normal" way to run it from the command line as far as I know is
1) compiling it (and creating the file Hello.class):
javac Hello.java
2) running it:
java Hello
I just found out by accident that it is also possible to just invoke
java Hello.java
without creating a Hello.class file first!
This also does not crate an own class file..
So now, I am asking myself, what exactly happens, when I just run java Hello.java?