Please enable JavaScript to use CodeHS

Chapter 3

Boolean Expressions and if Statements

3.7 Comparing Objects

Comparing Objects with == and !=

Comparing Using .equals()

Comparing Strings

Comparing Rectangles

Null Test

Identify Aliases

Check Your Understanding

  1. Incorrect Correct No Answer was selected Invalid Answer

Exercise: Three Strings

Vocabulary

Term Definition
Aliases Two object references are considered aliases when they both reference the same object.
Reference equality Equality operator (==) compares the references (addresses in memory) of 2 objects
Logical equality Compares the data of the objects instead of the value of the references. Uses the .equals() method.