Picture of Equivalent Data

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   go to next page        

Answer:

The Gingham Dog 
The Gingham Dog 

Picture of Equivalent Data

Here is a picture of this situation. Even though both objects have equivalent data inside of them, (strA == strB) is false.

== reports false because there are two different objects, each with a unique reference.

QUESTION 21:

three variables pointing at what?

Imagine that there are three reference variables: itemA, itemB, itemC. And say that

itemA == itemB

and that

itemB == itemC

.

How many objects are there?