Skip to content

Java basics: classes, main, and output

AP Computer Science A uses Java

  • The AP CSA exam is written in Java.
  • This site compiles Java with Java 8 language rules. Our standalone examples define a class with a main entry method. A helper class or an AP method answer does not need its own main.
  • You already think like a programmer — here we learn Java's rules.

A Java program: a class holds a main method, which holds the statements that run

Handout

Log in or create account

IGCSE, A-Level & AP