Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 482 Bytes

File metadata and controls

28 lines (20 loc) · 482 Bytes

The Main file

Inside your src folder make a file called Main.java. This is the file where we are going to write the "start" of the program.

All the Java code you've written up until now will work if you put it into this file.

void main() {
    IO.println("Hello, world!");
}

So you should now have something that looks like this.

project/
  src/
    Main.java

To run your program, use the java command.

$ java src/Main.java
Hello, world!