Online Java Compiler By
JavaTpoint.com
import java.util.Date; public class JavaDateEqualsExample1 { public static void main(String[] args) { Date d=new Date(2018,9,21); Date d1=new Date(1997,3,10); System.out.println("Date 'd' equals Date 'd1' : "+d.equals(d1)); } }
Output