LocalDate equals(Object obj) example
Description
LocalDate equals(Object obj)
checks if this date
is equal to another date.
Syntax
equals
has the following syntax.
public boolean equals(Object obj)
Example
The following example shows how to use equals
.
import java.time.LocalDate;
/*from w ww. j av a2 s.co m*/
public class Main {
public static void main(String[] args) {
LocalDate l = LocalDate.now();
System.out.println(l.equals(LocalDate.now()));
}
}
The code above generates the following result.