Online Java Compiler By
JavaTpoint.com
import java.util.Date; public class JavaDateCompareToExample2 { public static void main(String[] args) { Date d=new Date(1997,3,10); Date d1=new Date(1997,3,10); int comparison=d.compareTo(d1); System.out.println("Your comparison value is : "+comparison); } }
Output