Javatpoint Logo
Javatpoint Logo

Java Calendar getActualMaximum() Method

The getActualMaximum() method of java.util.Calendar class returns an integer value which is the Maximum possible value of the calendar field passed as parameter to getActualMaximum() method. For example Maximum value for DATE field is 31, and similarly Maximum value for MONTH field is 11 .

Syntax

Parameter

field - the field of calendar like MONTH, HOUR , DAY_OF_MONTH etc.

Returns

Returns an integer value which is maximum value of field passed as parameter.

Throws

Do not throw any exception.

Example 1

Test it Now

Output:

Maximum year value of Calendar is:292278994
Maximum year value of Gregorian Calendar is :292278994

Example 2

Test it Now

Output:

Maximum Month:11
Maximum DAY:31

Example 3

Test it Now

Output:

Maximum HOUR value:11
Maximum MINUTE value:59
Maximum SECOND value:59



Please Share

facebook twitter google plus pinterest