SSilver Sign up free
Free tool

Java code tracer

Step through Java line by line and watch every variable change — locals, the call stack, heap references and output. Real Java semantics: integer division, 32-bit overflow, array aliasing, string interning. Built for AP CSA code-tracing questions.

← / → step · runs fully in your browser
Main.java
Press Trace to run the code and record every step.

Variables

No trace yet.

Heap

Arrays, lists and objects appear here with their @id.

Output

What it covers

The AP CSA subset, with real Java behavior

Types int, double, boolean, char, String; if/else, while, for, for-each; methods and recursion; 1D and 2D arrays; ArrayList; classes with fields, constructors and methods. The 2025–26 framework removed inheritance, so extends and super are intentionally out. int math is true 32-bit (7 / 2 is 3; Integer.MAX_VALUE + 1 wraps), doubles print like Java (3.0), and == on Strings follows literal interning — the exact trap .equals() exists for.

FAQ

Java tracing questions

What is code tracing in Java?

Tracing means executing code by hand, line by line, while tracking the value of every variable. It is the core skill behind AP Computer Science A multiple-choice questions. This tool does the same thing on screen: each step shows the current line, every variable in every stack frame, heap objects, and the output so far.

What Java features does the tracer support?

The AP CSA subset: int, double, boolean, char and String; if/else, while, for and for-each; methods and recursion; 1D and 2D arrays; ArrayList; classes with fields, constructors and methods (the 2025–26 course framework removed inheritance, so extends and super are intentionally not included); Math and Integer helpers; System.out.print and println.

Does it show real Java behavior like integer division and overflow?

Yes. int math is true 32-bit: 7 / 2 is 3, Integer.MAX_VALUE + 1 wraps to Integer.MIN_VALUE, and doubles print like Java (3.0, not 3). String comparison with == follows literal interning, which is exactly why the tracer is a safe place to learn to use .equals().

Can I step backward?

Yes. The whole run is recorded first, so you can step forward and backward or scrub the timeline with a slider and keyboard arrows. Infinite loops are cut off by a step limit and shown as such.

Is this Java tracer free?

Yes. It runs entirely in your browser, needs no account, and works on Chromebooks. It is part of Silver, the practice platform that grades AP CSA free-response answers by rubric.