Please enable JavaScript to use CodeHS

AP Computer Science A (Nitro)

Lesson 3.7 Comparing Objects

Description

In this lesson, students will learn the different ways of comparing objects and how it is different than comparing primitive types. With objects, because the variable is pointing to a location, the use of == is not possible, as the memory address is being compared between objects, not the actual values. Students will discover and use the .equals method. This lesson corresponds with AP Computer Science A topic 3.7.


Objective

Students will be able to:

  • Compare object references using Boolean expressions in program code