Java Typing Test

Type real Java: classes, records, typed methods, braces and long names.

Java focusedClassesRecordsBracesLong names

Loading coding passages...

Java is the most verbose language on this site: long, descriptive names, a type before every variable, and a brace on almost every line. This test serves real Java so you can practise the part of Java that is pure typing: names, types and braces, typed cleanly at a steady pace.

What you will actually be typing

Two excerpts from the 10 Java passages in this test, shown exactly as you type them. Press Enter at the end of each line and the next line’s indentation is filled in for you. Each passage runs to several thousand characters, more than anyone types in five minutes.

A record and small helper classesJava 1 - Parser Profile Audit
public record ProfileRow(int id, String owner, String status, int completion, double score) {}
public ProfileRow parseProfile(String line) {
    String[] parts = line.split("\\|");
    return new ProfileRow(Integer.parseInt(parts[0]), parts[1], parts[2], Integer.parseInt(parts[3]), Double.parseDouble(parts[4]));
}

final class ProfileStatusGuard1 {
    boolean accepts(String status) { return "verified".equals(status) || "draft".equals(status); }
}

final class ProfileLabelPrinter2 {
    String label(ProfileRow row) { return "profile-" + row.id() + "-" + row.status(); }
}
The same shapes in a different taskJava 8 - Router Course Progress
public ResponseEntity<String> routeCourse(String method, String path) {
    if ("GET".equals(method) && "/courses".equals(path)) return ResponseEntity.ok("list");
    if ("POST".equals(method) && "/courses".equals(path)) return ResponseEntity.ok("created");
    return ResponseEntity.notFound().build();
}

final class CourseScoreBlock8 {
    int score(CourseRow row) { return row.lessons() + (int) row.progress(); }
}

final class CourseStatusGuard9 {
    boolean accepts(String status) { return "complete".equals(status) || "started".equals(status); }

Who this test is for

Java and Android developers, computer science students working through Java coursework, and anyone preparing for a Java role where they will write a lot of boilerplate under time pressure.

If you mostly write Kotlin or C#, the habits transfer: PascalCase types, camelCase methods and brace-delimited blocks are the same mechanical skill.

Java Typing Test: the test at a glance
Durations1, 2, 3 or 5 minutes
Passages10 Java passages, 45,460 characters in all; choose one before you start
DifficultyOne level: every passage is real working code, not graded drills
What countsEvery character and line break must match the passage. Enter fills in the next line’s indentation; Tab inserts two spaces
SpeedGross WPM = characters typed ÷ 5 ÷ minutes. Net WPM takes one word off per error
AccuracyOverall accuracy, plus symbol accuracy: the share of brackets, quotes and operators typed correctly
Report cardSeparate counts for symbol, bracket, quote, semicolon, whitespace and new-line mistakes

The Java symbol profile

Across 10 passages and 45,460 characters, Java here averages 13.7 symbols per 100 characters, lower than JavaScript because so much of each line is names and type keywords.

Capitals are 4.4% of characters, the most of any language apart from SQL, from class names, type names and constants. Java typing is long words, Shift for capitals and a steady brace rhythm.

13.7Symbols per 100 characters
3.3%Indentation
4.4%Capital letters
6.9Average name length
The most frequent symbols in these passages, per 100 characters typed.
SymbolPer 100 characters
( parenthesis2.4
) parenthesis2.4
" double quote1.6
{ brace1.6
} brace1.6
. dot1.4
; semicolon0.8
+ plus0.8

The symbol runs you will type most

Empty and closing parentheses dominate: () from no-argument calls and (); from calls that end a statement. ". marks the common "literal".equals(value) pattern.

Two or more symbols typed back to back, counted per 1,000 characters of these passages.
RunPer 1,000 characters
()5.7
();3.9
".3.9
);1.9
-"1.9
"-"1.9

How Java compares with the other coding tests

Measured on each test's own passages. The highlighted column is this page.
MeasureHTML & CSSJavaJavaScriptPythonSQLTypeScript
Symbols per 100 characters17.213.716.914.36.516.1
Indentation, share of characters2.6%3.3%3%8.2%0.1%1.6%
Capital letters, share of characters2%4.4%2.4%0.5%22%4%
Average name length5.5 chars6.9 chars6.2 chars5.8 chars6.3 chars6.5 chars
Average line length37 chars39.1 chars36.6 chars40.3 chars32.6 chars53.4 chars

Typing Java: names, types and braces

Names carry the weight. Identifiers in these passages average 6.9 characters, the longest of any language here. Google’s Java style guide asks for UpperCamelCase class names and lowerCamelCase method names, so a long name typically includes two or three Shift presses for its capitals. Type long names in chunks (Profile, Status, Guard) rather than letter by letter.

Braces are everywhere: 97.9% of the lines in these passages contain one. Google’s guide uses Kernighan and Ritchie style, with the opening brace at the end of the line, and braces even around single-statement bodies, so the brace is part of nearly every line ending. Make space, {, Enter one movement.

Parentheses are the most frequent symbol here, from method calls and parameter lists. Semicolons appear in 34.1% of lines; many of the passages use short one-line methods that end in ; } on the same line.

Indentation matters less to the compiler than in Python, and in the test you do not type it: Enter fills in the next line’s indent. The passages use four spaces per level, which is common in Java code, although Google’s guide itself uses two.

Anatomy of one line

A complete method on one line: return type, name, typed parameter, a brace-delimited body, two string comparisons joined by ||, and a semicolon before the closing brace.

    boolean accepts(String status) { return "verified".equals(status) || "draft".equals(status); }
Counted keystroke by keystroke, as the line appears in the passage.
Characters98, of which 4 are indentation
Letters69
Symbols17
Spaces12
Keys that need Shift15

Reading your Java report card

Bracket errors come first in Java, because a missing brace or parenthesis is the error that most often derails a run: one-line methods close a call, a body and sometimes a class in quick succession. Then check overall accuracy on letters, which in Java includes the capitals inside long camelCase and PascalCase names.

Quote errors cluster around string comparisons such as "draft".equals(status), where the literal comes first. Whitespace errors are spaces inside a line, after commas or around operators, since indentation is filled in for you.

Mistakes the report card will show most

  • A lower-case letter at the start of a class or type name, or a capital at the start of a method name.
  • A missing closing brace at the end of a one-line method body.
  • The wrong number of closing parentheses in nested calls such as Integer.parseInt(parts[0]).
  • A semicolon left out before the closing brace of a one-line method.

The habits that apply to every kind of typing, such as accuracy before speed and short daily practice, are in how to type faster. For symbols on their own, use the symbol typing test.

A three-step practice plan

The aims below are our suggestions, not pass marks. The test itself has no pass mark; it reports your speed and accuracy and lets you judge the trend.

StepRunAim for
Warm up1 minute on the alpha-numeric typing testCapitals inside words without breaking rhythm
Build2-minute Java runs, rotating passagesNo bracket errors in the report card
Stretch5-minute Java runsSymbol accuracy of 95% or more

Frequently asked questions

What Java code does the test include?

10 passages with records, small final classes, typed methods, collections, string building and validation logic. Every character is typed exactly as shown, except indentation, which is filled in when you press Enter.

Why is Java slower to type than other languages?

Mostly because of length, not symbols. Names here average 6.9 characters, and every variable carries a type, so there is simply more to type per idea. Steady chunking of long names helps more than raw finger speed.

Does the report card count brace mistakes separately?

Yes. Bracket errors (braces, parentheses and square brackets) are listed separately, alongside quote, semicolon, whitespace and new-line errors.

Is this useful for Java interviews?

It helps with the mechanical part: getting signatures, braces and names down cleanly while you think about the problem. It is not interview preparation in itself.

Why do the passages use records?

Records are a compact, modern way to declare data classes in Java, and they put a typed parameter list in a single line, which makes them good typing practice.

Do I need to know Java to use this test?

It helps to recognise the shapes, but no. You type exactly what you see; the test does not compile or run the code.

Are Java generics included?

Yes, in places: types such as ResponseEntity<String>, List and Map with type arguments appear in the passages, so angle brackets are part of the practice, though less often than in TypeScript.

Other coding typing tests

Sources

Conventions cited on this page come from the sources below. Every figure about the passages is measured from the passages themselves, and recalculated each time the site is built.

  1. Google Java Style GuideGoogle · link checked 20 Oct 2026