java.util.Calendar getAvailableCalendarTypes()

Description :

This java tutorial shows how to use the getAvailableCalendarTypes() method of Calendar class of java.util package. This method returns an unmodifiable Set containing all calendar types supported by Calendar in the runtime environment.

Method Syntax :

public static Set<String> getAvailableCalendarTypes()

Parameter Input :

 

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

 

Method Returns :

This method returns an unmodifiable Set containing all available calendar types

Compatibility Version :

Requires Java 1.8 and up

Exception :

N/A

Java Code Example :

This java example source code demonstrates the use of getAvailableCalendarTypes()  method of Calendar class. Basically we just print the contents of the set that has been returned by getAvailableCalendarTypes() method.

package com.javatutorialhq.java.examples;

import java.util.Calendar; import java.util.Date; import java.util.Set;

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

public class CalendarGetAvailableCalendarTypesExample {

public static void main(String

[] args) throws InterruptedException {

Set set = Calendar.getAvailableCalendarTypes(); for(String s:set){ System.out.println(s); }

}

}

Sample Output :

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

gregory
buddhist
japanese

Exception Scenario :

N/A

Similar Method :

  • N/A

Suggested Reading List :

References :