Calendar getCalendarType() in Java

getCalendarType(): This method is available in java.util.Calendar class of Java.

Syntax:

String java.util.Calendar.getCalendarType()

This method returns the calendar type of this Calendar. Calendar types are defined by the Unicode Locale Data Markup Language (LDML)specification.

Parameters: NA

Returns: the LDML-defined calendar type or the class name of this Calendar instance.

Exceptions: NA

Approach

Java

import java.util.Calendar;

public class CalendargetCalendarType {
    public static void main(String[] args) {

        // create a calendar
        Calendar calendar = Calendar.getInstance();

        System.out.println(calendar.getCalendarType());

    }
}

Output:

gregory


No comments:

Post a Comment