Java Calendar getMaximum() MethodThe getMaximum() method of java.util.Calendar class is an abstract method. This method is used with calendar object to get the maximum value of specified calendar field as parameter. SyntaxParameterfield - the calendar field. ReturnsThe maximum value for the given calendar field. ThrowsDo not throw any Exception Example 1Test it NowOutput: Date :Sun Aug 05 00:36:49 PDT 2018 The Maximum (Year) is: 292278994 The Maximum (Month) is: 11 The Maximum (Day) is: 7 Date :Sat May 28 00:36:49 PDT 4039 The Maximum (Year) is: 292278994 The Maximum (Month) is: 11 The Maximum (Day) is: 7 Example 2Test it NowOutput: Date :Sat Nov 23 00:00:00 PST 1996 The Maximum (Year) is: 292278994 The Maximum (Month) is: 11 The Maximum (Day) is: 7
Next TopicJava Calendar Class
|