Calendar getLeastMaximum() method in Java with Examples Last Updated : 19 Feb, 2019 Comments Improve Suggest changes Like Article Like Report The getLeastMaximum(int calndr_field) method in Calendar class is used to return the lowest maximum value for the given calendar field(int calndr_field) of this Calendar instance. Syntax: public abstract int getLeastMaximum(int calndr_field) Parameters: The method takes one parameter calndr_field that refers to the calendar field which is to be operated upon. Return Value: The method returns the lowest maximum value of this calendar field. Below programs illustrate the working of getLeastMaximum() Method of Calendar class: Example 1: Java // Java code to illustrate // getLeastMaximum() method import java.util.*; public class Calendar_Demo { public static void main(String args[]) { // Creating a calendar Calendar calndr = Calendar.getInstance(); // Getting the required months System.out.println("Required Months: " + calndr.get(Calendar.MONTH)); // Getting the lowest maximum month int low_max = calndr.getLeastMaximum(Calendar.MONTH); // Displaying the results System.out.println("The Lowest" + " Maximum months: " + low_max); } } Output: Required Months: 1 The Lowest Maximum months: 11 Example 2: Java // Java code to illustrate // getLeastMaximum() method import java.util.*; public class Calendar_Demo { public static void main(String args[]) { // Creating a calendar Calendar calndr = new GregorianCalendar(2018, 6, 10); // Getting the required months System.out.println("Required Months: " + calndr.get(Calendar.MONTH)); // Getting the lowest maximum month int low_max = calndr.getLeastMaximum(Calendar.MONTH); // Displaying the results System.out.println("The Lowest" + " Maximum months: " + low_max); } } Output: Required Months: 6 The Lowest Maximum months: 11 Reference: https://docs.oracle.com/javase/8/docs/api/java/util/Calendar.html#getLeastMaximum-int- Comment More infoAdvertise with us Next Article Calendar getLeastMaximum() method in Java with Examples C chinmoy lenka Follow Improve Article Tags : Misc Java Java-Functions Java 8 Java-Calendar +1 More Practice Tags : JavaMisc Similar Reads Calendar getMaximum() method in Java with Examples The getMaximum(int calndr_field) method in Calendar class is used to return the maximum value for the given calendar field(int calndr_field) of this Calendar instance. Syntax: public abstract int getMaximum(int calndr_field) Parameters: The method takes one parameter calndr_field that refers to the 2 min read Calendar getActualMaximum() Method in Java with Examples The getActualMaximum(int field_value) method of Calendar class is used to return the maximum value that the specified calendar field could have, based on the time value of this Calendar. Syntax: public int getActualMaximum(int field_value) Parameters: The method takes one parameter field_value of in 2 min read Calendar getGreatestMinimum() Method in Java with Examples The getGreatestMinimum(int calndr_field) method in Calendar class is used to return the highest minimum value for the given calendar field(int calndr_field) of this Calendar instance. Syntax: public abstract int getGreatestMinimum(int calndr_field) Parameters: The method takes one parameter calndr_f 2 min read Calendar getMinimum() Method in Java with Examples The getMinimum(int calndr_field) method in Calendar class is used to return the Minimum value for the given calendar field(int calndr_field) of this Calendar instance. Syntax: public abstract int getMinimum(int calndr_field) Parameters: The method takes one parameter calndr_field that refers to the 2 min read Calendar getActualMinimum() Method in Java with Examples The getActualMinimum(int field_value) method of Calendar class is used to return the minimum value that the specified calendar field could have, based on the time value of this Calendar. Syntax: public int getActualMinimum(int field_value) Parameters: The method takes one parameter field_value of in 2 min read Like