Javatpoint Logo
Javatpoint Logo

Java Calendar getGreatestMinimum() Method

The getGreatestMinimum() method of java.util.Calendar class is an abstract method. This method returns (maximum value out of all minimum values) highest minimum value of Calendar field passed as the parameter.

Syntax

Parameter

field - This method accepts Calendar field as parameter.

Returns

Returns an integer value which is the most significant value from all minimum values, i.e., the highest minimum value of passed Calendar field is returned.

Throws

Does not throw Exception

Example 1

Test it Now

Output:

Date :Sat Nov 23 00:00:00 PST 1996
The minimum (Year) is: 1
The minimum (Month)  is: 0
The minimum (Day) is: 1

Example 2

Test it Now

Output:

Date :Sat Aug 04 14:36:36 PDT 2018
The minimum (Year) is: 1
The minimum (Month)  is: 0
The minimum (Day) is: 1
 
Date :Fri May 27 14:36:36 PDT 4039
The minimum (Year) is: 1
The minimum (Month)  is: 0
The minimum (Day) is: 1



Help Others, Please Share

facebook twitter pinterest