Say that you know that thing1.equals( thing2 ) is FALSE.
What can you then say about (thing1 == thing2 ) ?
Answer:
(thing1 == thing2 ) will be false, because
the only way for thing1.equals( thing2 ) to be false
is for there to be two objects.
End of the Chapter
If you feel equal to the task, review the following topics.
- Data type.
- Primitive data types vs. objects.
- Picture of a String object.
- The two steps of an assignment operator.
- Definition of object reference.
- What each type of variable contains, and how each type is used.
- Garbage and garbage collection.
- Assigning a new value to a reference variable.
-
The
==operator and reference variables. - Two references to one object.
- String literals.
- equals() method.
The next chapter continues the discussion of objects and classes.