Example usage for java.util Calendar getLeastMaximum

List of usage examples for java.util Calendar getLeastMaximum

Introduction

In this page you can find the example usage for java.util Calendar getLeastMaximum.

Prototype

public abstract int getLeastMaximum(int field);

Source Link

Document

Returns the lowest maximum value for the given calendar field of this Calendar instance.

Usage

From source file:Main.java

public static void main(String[] args) {

    Calendar cal = Calendar.getInstance();

    // get the days required in the first week of the year
    System.out.println("Months required: " + cal.get(Calendar.MONTH));

    // print the lowest maximum months for year.
    int max = cal.getLeastMaximum(Calendar.MONTH);
    System.out.println("Lowest maximum months :" + max);

}