KNOW:
int
and double
)
equals()
method is the same behavior as = =
BE ABLE TO:
equals()
method for a class that is based on the contents of the objects
Sample Exam Question:
A student class is defined as follows:
class Student{ String name; int studentID; // ID number that uniquely identifies student Student (String name, int studentID){ this.name = name; this.studentID = studentID; } }Write an
equals()
method for the Student
class that returns true if the two students being compared have the same ID number.