LocalDateTime equals(Object obj)
checks if this
date-time is equal to another date-time.
equals
has the following syntax.
public boolean equals(Object obj)
The following example shows how to use equals
.
import java.time.LocalDateTime; public class Main { public static void main(String[] args) { LocalDateTime a = LocalDateTime.now(); System.out.println(a.equals(LocalDateTime.now())); } }
The code above generates the following result.