← codetypingtest

Java typing test

Java is famously wordy, which makes it a good endurance test. Even FizzBuzz needs a class and a main method before the loop starts, and every line that prints spells out System.out.println. Capitalised names like String, ArrayList and Integer add Shift presses in the middle of the flow.

Start the Java typing test

What you'll type in Java

Example: FizzBuzz in Java

Count the closing braces at the end: one each for the loop, the method and the class. The indentation is filled in for you, but every brace is yours to type.

public class Main {
    public static void main(String[] args) {
        for (int i = 1; i <= 15; i++) {
            if (i % 15 == 0) System.out.println("FizzBuzz");
            else if (i % 3 == 0) System.out.println("Fizz");
            else if (i % 5 == 0) System.out.println("Buzz");
            else System.out.println(i);
        }
    }
}

Type this program now

Tips for typing Java faster

All 20 Java programs

Every program is real, working Java. Choose one to start typing it straight away.

Beginner

Intermediate

Advanced

Expert

How the test works

The timer starts on your first key and stops once every character is right. Press Enter for a new line and the indentation is filled in for you. A wrong key shows in red and counts as a mistake; press Backspace to go back and fix it. Your best time for each program is saved in your browser. Read more about how speed and accuracy are calculated, or get tips for typing code faster.

Other languages