Java Calendar complete() MethodThe complete() method of java calendar class is a protected method. This method can be called by any subclass within its class, but not by unrelated classes. It fills any unset fields in the calendar fields. ComputeTime() and ComputeField() are called to calculate time value and all the calendar field values. SyntaxParameterNA ReturnsThis method does not return any value. ThrowsNA Example 1Output: The current date is : Tue Jul 31 19:56:09 PDT 2018 New date is : Thu Jan 01 00:00:00 PST 1998 Example 2Output: The current date is : Tue Jul 31 19:56:28 PDT 2018 New Month is : Sun Nov 01 00:00:00 PST 1970 Example 3Output: The current date is : Tue Jul 31 19:57:33 PDT 2018 New day is : Fri Jan 23 00:00:00 PST 1970 Example 4Output: The current date is : Tue Jul 31 20:01:19 PDT 2018 New DATE is : Wed Oct 23 22:01:00 PDT 1996 Next TopicJava-calendar-computefields-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India