Calendar class getMinimum(int field) method example
Returns the minimum value for the given calendar field of this Calendar instance.
Calendar class getMinimum(int field)method example. This example shows you how to use getMinimum(int field)method.This method Returns the minimum value for the given calendar field of this Calendar instance.
Here is the code:-
/*
* @Program that Returns the minimum value for the given calendar field of
this Calendar instance.
* GetMinimum.java
* Author:-RoseIndia Team
* Date:-23-May-2008
*/
import java.util.*;
public class GetMinimum {
public static void main(String[] args) {
Calendar c= Calendar.getInstance();
System.out.println(" Current Year is : "+c.get(Calendar.YEAR));
// Returns the minimum value for the given calendar field of this
//Calendar instance.
int i=c.getMinimum(Calendar.DAY_OF_YEAR);
System.out.println("Minimum value for the given Year is : "+i);
}
} |
Output of the program:-
Current Year is : 2008
Minimum value for the given Year is : 1 |
|