Online Java Compiler By
JavaTpoint.com
import java.util.GregorianCalendar; public class JavaCalendargetCalendarTypeExample2 extends GregorianCalendar{ //extending GregorianClass public static void main(String[] args) { // creating an instance of type GregorianCalendar GregorianCalendar calinstance = (GregorianCalendar) GregorianCalendar.getInstance(); // getting the Calendar type using getCalendarType method. System.out.println("Type of Calendar is: " + calinstance.getCalendarType()); } }
Output