Calendar computeFields() method in Java with Examples
The computeFields() method in Calendar class is used for the conversion operation of the current millisecond time value time to calendar field values mentioned in the fields.
Note: This allows syncing up the new time that is set for the calendar object with the calendar field values.
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.
protected abstract void computeFields()
Parameters: The method does not take any parameters.
Return Value: The method does not return any value.
Below programs illustrate the working of computeFields() Method of Calendar class:
The Current date is: Wed Feb 13 16:15:15 UTC 2019 The recent date is: Wed Feb 13 16:15:15 UTC 2019
The Current date is: Wed Feb 13 16:15:18 UTC 2019 The recent date is: Wed Feb 13 16:15:18 UTC 2019