Calendar isSet() Method in Java with Examples
The isSet(int calndr_field) method in Calendar class is used to check whether the given calendar field has a value set or not. All the Cases for which the values have been set by the calculations of the internal field are triggered by a get method call.
public final boolean isSet(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 either returns True if the value of the calendar fiels is set else it returns False.
Below programs illustrate the working of isSet() Method of Calendar class:
The Year is: 2019 Is the Value set? true Is the Value set? false
Todays Day is: 21 Is the Value set? true Is the Value set? false
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.