Two Steps

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   hear noise   go to next page

Answer:

FIRST, the multiplication 2*3 is performed to get the value 6.

Two Steps

First, the expression on the right is calculated:

Do First

Next, the result of that calculation is put into the "litte box of memory" that is the variable value:

Do Second

It will really, really help you to think carefully about these two steps. Sometimes even second year computer science majors get confused about this and write buggy code.

QUESTION 13:

What will this program fragment write?

value = 2*3;
System.out.println( "value holds: " + value );