Calendar getActualMinimum(int) in Java

getActualMinimum(int): This method is available in java.util.Calendar class of Java.

Syntax:

int java.util.Calendar.getActualMinimum(int field)

This method takes one argument of type int as its parameter. This method returns the minimum value that the specified calendar field could have, given the time value of this Calendar.

Parameters: One parameter is required for this method.

field: the calendar field.

Returns: the minimum of the given calendar field for the time value of this Calendar.

Exceptions: NA

Approach

Java

import java.util.Calendar;

public class CalendargetActualMinimum {
    public static void main(String[] args) {

        // create a calendar
        Calendar calendar = Calendar.getInstance();
        int field = 1;

        System.out.println(calendar.getActualMinimum(field));

    }
}

Output:

1


No comments:

Post a Comment