Home » Java programming language

Java Calendar getActualMinimum() Method with Example

Calendar Class getActualMinimum() method: Here, we are going to learn about the getActualMinimum() method of Calendar Class with its syntax and example.
Submitted by Preeti Jain, on January 26, 2020

Calendar Class getActualMinimum() method

  • getActualMinimum() method is available in java.util package.
  • getActualMinimum() method is used to return the minimum value that the given calendar field holds depend on the time of this Calendar.
  • getActualMinimum() method is a non-static method, it is accessible with the class object and if we try to access the method with the class name then we will get an error.
  • getActualMinimum() method does not throw an exception at the time of returning the minimum value of the given parameter.

Syntax:

    public int getActualMinimum(int fi);

Parameter(s):

  • int fi – it represents the calendar field.

Return value:

The return type of the method is int, it returns the minimum value of the given calendar field(fi).

Example:

// Java Program to demonstrate the example of
// int getActualMinimum(int fi) method of Calendar

import java.util.*;

public class GetActualMinimumOfCalendar {
    public static void main(String[] args) {
        // Instantiating a Calendar object
        Calendar ca = Calendar.getInstance();

        // Display current calendar
        System.out.println("ca : " + ca.getTime());

        // By using getActualMinimum() method is to
        // return the minimum value of the given field
        // that can hold

        int year = ca.getActualMinimum(Calendar.YEAR);
        int month = ca.getActualMinimum(Calendar.MONTH);
        int day = ca.getActualMinimum(Calendar.DATE);

        // Display Minimum value of Calendar Fields
        System.out.println("ca.getActualMinimum(Calendar.YEAR): " + year);
        System.out.println("ca.getActualMinimum(Calendar.MONTH): " + month);
        System.out.println("ca.getActualMinimum(Calendar.DATE): " + day);
    }
}

Output

ca : Sun Jan 26 10:56:32 GMT 2020
ca.getActualMinimum(Calendar.YEAR): 1
ca.getActualMinimum(Calendar.MONTH): 0
ca.getActualMinimum(Calendar.DATE): 1






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.





Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.