Javatpoint Logo
Javatpoint Logo

Java Calendar getMaximum() Method

The getMaximum() method of java.util.Calendar class is an abstract method. This method is used with calendar object to get the maximum value of specified calendar field as parameter.

Syntax

Parameter

field - the calendar field.

Returns

The maximum value for the given calendar field.

Throws

Do not throw any Exception

Example 1

Test it Now

Output:

Date :Sun Aug 05 00:36:49 PDT 2018
The  Maximum (Year) is: 292278994
The  Maximum (Month)  is: 11
The  Maximum (Day) is: 7
 Date :Sat May 28 00:36:49 PDT 4039
The  Maximum (Year) is: 292278994
The  Maximum (Month)  is: 11
The  Maximum (Day) is: 7

Example 2

Test it Now

Output:

Date :Sat Nov 23 00:00:00 PST 1996
The  Maximum  (Year) is: 292278994
The  Maximum  (Month)  is: 11
The  Maximum  (Day) is: 7



Help Others, Please Share

facebook twitter pinterest