OffsetDateTime equals(Object obj) example
Description
OffsetDateTime equals(Object obj)
checks if this date-time is equal to another date-time.
Syntax
equals
has the following syntax.
public boolean equals(Object obj)
Example
The following example shows how to use equals
.
import java.time.OffsetDateTime;
// ww w .j a v a 2 s. c o m
public class Main {
public static void main(String[] args) {
OffsetDateTime o = OffsetDateTime.MAX;
System.out.println(o.equals(OffsetDateTime.MIN));
}
}
The code above generates the following result.