Online Java Compiler By
JavaTpoint.com
import java.util.*; public class JavaCalendarhashCodeExample2 { public static void main(String[] args) { // create a new calendar GregorianCalendar mycal = (GregorianCalendar) GregorianCalendar.getInstance(); // print the current date and time System.out.println(" current Time : " + mycal.getTime()); // print a hashcode for this calendar System.out.println("Hash Code:" + mycal.hashCode()); } }
Output