Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+17 votes

I am trying to see how my for loop will run but I do not know how to use the Java visualizer. How do I use the Java visualizer?

asked in CSC211_Winter2018 by (1 point)

1 Answer

+10 votes

The java visualizer will give you an outline for your class and main method. From there, all you need to do is copy/paste or write your for loop in the box beneath the main method.

Be sure to include the correct number of open and closed curly brackets. Then hit the "Visualize Execution" box under the box containing the code. Now you can see the number of steps in the loop and see what each one does with a press of the "Forward" button.

That should be all it takes to use this tool, but it will not work unless the code is typed correctly and the right amount of curly brackets are used.

answered by (1 point)
...