Chapter 3 | ![]() |
| The Heap Quiz Assignment was to match each reference variable with matching object(s). Which taught me how to identify which object belong to with reference variable using the Heap analogy. |
![]() |
| This program was a fill-in-the-blank to help the reader recognize what the program is doing and how it can be completed. |
- · Variables come in two flavors: primitive and reference.
- · Variables must always be declared with a name and a type.
- · A primitive variable value is the bits representing the value (5, ‘a’, true, 3.1416, etc.).
- · A reference variable value is the bits representing a way to get to an object on the heap.
- · A reference variable is like a remote control.
- · Using the dot operator (.) on a reference variable is like pressing a button on the remote control to access a method or instance variable.
- · A reference variable has a value of Null when it is not referencing any object.
- · An array is always an object, even if the array is declared to hold primitives. There is no such thing as a primitive array, only an array that holds primitives.
One thing I thought was interesting and helpful was the use of arrays. An array is an object that hold primitives. This allows making object much easier and faster by assigning reference variable for the objects.
| Code program for random student chooser |




