Skip Top Navigation Bar

Comparing Objects with the Equals Method

Comparing Objects

To compare objects, you will want to use a method. The equals method, which is avaiable for all classes, can be used. Not all classes have a specific implementation of the equals method, so you will want to look at the API to see if there is an implementation for the class.

String Class Equals Method

boolean equals(Object anObject)

This method returns

LocalDate Class Equals Method

boolean equals(Object obj)

This method returns

Resources