R
Robert Mark Bram
Howdy All!
int number = 3;
Object obj = new Object();
Would I correct in saying:
- as a primitive, the value of number is 3;
- as an object reference, the value of obj is a "reference" to the object
variable created on the rest of the line.
Thus..
int number1 = 3;
int number2 = 3;
Object obj1 = new Object();
Object obj2 = new Object();
number1 == number2;
True because their values are equal (3 == 3).
obj1 == obj2;
False because their values are different (obj1's value is a reference to the
first object: obj2's value is a reference to the second object).
Thanks for any assistance!
Rob
int number = 3;
Object obj = new Object();
Would I correct in saying:
- as a primitive, the value of number is 3;
- as an object reference, the value of obj is a "reference" to the object
variable created on the rest of the line.
Thus..
int number1 = 3;
int number2 = 3;
Object obj1 = new Object();
Object obj2 = new Object();
number1 == number2;
True because their values are equal (3 == 3).
obj1 == obj2;
False because their values are different (obj1's value is a reference to the
first object: obj2's value is a reference to the second object).
Thanks for any assistance!
Rob