Teaching tool · Java

JavaLens

A Java visualizer for intro programming

JavaLens stepping through a recursive binary-tree insert: the Java code on the left, nested insert calls on the call stack and Node objects with reference arrows on the heap

Overview

Type Java on the left; the right side shows the call stack, with recursion frames pushing and popping, the objects on the heap with their reference arrows, and the output. It re-runs as you type.

How it works

Call stack

Each method call is a frame; recursion shows as frames pushing and popping, newest at the bottom.

Heap and references

Objects and arrays sit on the heap, with an arrow from every reference that points to them.

Re-runs as you type

Change the code and the picture updates, step by step, without a separate run.

Ships everywhere

Desktop installers for Windows, macOS and Linux, and an extension on the VS Code Marketplace and Open VSX.

Challenges and what I learned

A longer write-up of this part is on the way.

JavaLens at the end of a run: an int array and a binary tree of seven Node objects on the heap, linked by arrows