I was just wondering...
why can i have only one instance of Calendar object. Is there a reason for it to be a singleton?
I have tried to read the documentat
You can have as many instances of Calendar
as you want ... modulo that it is an abstract class, so you are talking about of instances of child classes of Calendar.
Perhaps you think that the getInstance()
method returns a singleton object? It doesn't. It creates and returns a new object each time you call it.
(The javadoc doesn't explicitly state that the calendar is not a singleton, but it says "The Calendar returned is based on the current time ...". That implies that it is returning a new object each time ... because the current time keeps changing. And anyway, that's what the method does if you'd care to look at the source code.)