Calendar toString() Method in Java with Examples
The toString() method in Calendar class is used to get the string representation of the Calendar object. This method in Calendar Class is just for debug process and not to be used as an operation.
public String toString()
Parameters: The method does not take any parameters.
Return Value: The method returns the String representation of the Calendar object. It can return an empty object but not null.
Below programs illustrate the working of toString() Method of Calendar class:
The string form: Wed Feb 13 09:46:36 UTC 2019
The string form: Wed Jan 02 00:00:00 UTC 2019
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.