Java Calendar isSet() MethodThe isSet() method of java.util.Calendar class is a final method which returns the Boolean value. This method checks whether the passed parameter value is set or not. If it is not set, it returns false otherwise true SyntaxParameterfield - the calendar field. ReturnsReturns a Boolean value. ThrowsDoes not throw Exception. Example 1Test it NowOutput: Today Mon Aug 13 22:21:16 PDT 2018 Year is set: true Year is set: false Example 2Test it NowOutput: Today Mon Aug 13 22:29:19 PDT 2018 Year is set: true Month is set: true Day of week is set: true After clearing calendar Year is set: false Month is set: false Day of week is set: false
Next TopicJava Calendar Class
|