go to previous page   go to home page   go to next page hear noise highlighting

Answer:

Are a business card, your phone number, and the actual you different things? — Yes

Are a variable, a reference, and an object different things? — Yes

(See chapter 11 for a picture.)


Object Reference

Reference to a String Object

An object is constructed out a block of main memory and hence has a unique location.

An object reference describes the location in memory of a particular object. In the picture, the variable str contains a reference to the object.

Objects are created while a program is running. When an object reference is assigned to a variable, then that variable says how to find that object in memory.

In diagrams, an object reference is shown as an arrow from the object reference variable to the object. (An object reference is actually a bit pattern.)


QUESTION 6:

What does a variable of a primitive type contain?


go to previous page   go to home page   go to next page