Java Visualizer

Java Visualizer

An Online Tool for viewing memory and output as a Java program executes

General Info | Getting Started

General Information:

It is important for students to understand how different Java statements are executed, the output produced, and how they change the contents of memory while a program is running. The good folks at University of Waterloo have developed a tool that does just that for Java programs.

CS 302 students can paste code fragments into the form and then execute the program one statement at a time and view a simplified diagram of memory. By doing this you can visualize how memory changes and hopefully understand why your code produces the results that it does.  This will also help you correctly trace your code and knowing how to accurately trace code statements is a critical skill for all programmers.

Try it today at: http://cscircles.cemc.uwaterloo.ca/java_visualize/

Getting Started

Java Visualizer is available to you anywhere you have access to the internet. Registration is not required, but you can track your progress while learning Python from their site if you do register: http://cscircles.cemc.uwaterloo.ca which has a nice Python tutorial.  This is not an endorsement.

What should you do with Java Visualizer

  1. Go to: http://cscircles.cemc.uwaterloo.ca/java_visualize/
  2. Type some code in the main method. For example:
    System.out.println( "Welcome to Java Visualizer.\n" );
  3. Click Click "Visualize Execution" button.
  4. Watch what is diagrammed in memory or output to the console window.
  5. Repeat until all statements have been executed and program terminates.
  6. Edit code with some statement that you want to review.
  7. Repeat steps 3-6.

Here are some simple programs to visualize: