More Practice

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:

value holds: 6

More Practice

Here is another program fragment:

int extra;
extra = 5;

The assignment statement is correct. It matches the syntax:

variableName = expression;

The expression is the literal 5. No calculation needs to be done. But the assignment statement still takes two steps. The first step gets the 5:

Do First

The second step puts the 5 in the variable:

Do Second

QUESTION 14:

How long will the variable hold the value 5?