Online Java Compiler By
JavaTpoint.com
import java.util.*; public class JavaCalendarhashCodeExample1 { public static void main(String[] args) { // create a calendar Calendar mycal = Calendar.getInstance(); // display current calendar System.out.println("The current time: " + mycal.getTime()); // get the hash code and print it int i = mycal.hashCode(); System.out.println(" Hash Code " + i); } }
Output