Calendar class toString()
Calendar class toString() method example
Calendar class toString()method example. This example shows you how to use toString()method.This method Return a string representation of this calendar.
Here is the code:-
/**
* @Program that Gets a calendar using the specified time zone and default
* locale.
* toStringcalender.java
* Author:-RoseIndia Team
* Date:-22-May-2008
*/
import java.util.*;
public class toStringcalender {
public static void main(String[] args) {
Calendar c=Calendar.getInstance();
// Return a string representation of this calendar.
System.out.println(c.getTime().toString());
}
} |
Output of the program:-
| String representation is:Thu May 22 19:06:38 IST 2008 |
|