Quick 115 Java Guide


We will use the Java programming langauge to do a few programming tasks.

// bare minimum Java starter (rename class as needed)
public class Main {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}

Most important Java notes:


Java input/output example with prompt utilities


Java IDEs

Online IDE

tldr: has ads, you have to remember to save.

This online Java IDE -- an editor that also lets you run code right in the browser -- unfortunately does have ads, which may be misleading. One side of the page is the code editor. At the top there is a Run button, and the other side shows the output (or errors). You can edit the code in the editor and run it as many times as you want. You do not need to download any extra tools to use this page, but you do need to be careful to save your files, it will not automatically do this for you!!

NetBeans

tldr: no ads; autosaves on run; lots of tools. Files live in a project directory.

Netbeans is on the classroom computers. You can install NetBeans at home.

You will need to create a project in Netbeans for your files to live in. You can have multiple projects, but multiple .java files for different programs can all live in the same project as long as each .java file has a unique name. Files in your project are listed on the left, you can double click to open them in the editor on the right and right click them or their code in the editor to Run File; output or errors will be shown at the bottom.