java.util.Calendar getCalendarType()

Description :

This java tutorial shows how to use the getCalendarType() method of Calendar class of java.util package. This method returns the calendar type of this Calendar. Calendar types are defined by the Unicode Locale Data Markup Language (LDML) specification.

Method Syntax :

public String getCalendarType()

Parameter Input :

DataType Parameter Description
N/A N/A N/A

Method Returns :

This method returns the LDML which defined calendar type or the class name of this Calendar instance

Compatibility Version :

Requires Java 1.8 and up

Exception :

N/A

Java Code Example :

This java example source code demonstrates the use of getCalendarType()  method of Calendar class.

package com.javatutorialhq.java.examples;

import java.util.Calendar;

/*
 * This example source code demonstrates the use of  
 * getCalendarType() method of Calendar class
 */

public class CalendarGetCalendarTypeExample {

	public static void main(String[] args){	
		
		Calendar cal = Calendar.getInstance();		
		// Getting the desired parameters
		System.out.println(cal.getCalendarType());
		
		
	}

}

Sample Output :

Running the getCalendarType() method example source code of Calendar class will give you the following output:

gregory

Exception Scenario :

N/A

Similar Method :

  • N/A

Suggested Reading List :

References :