Public static void main (string [] ARGs) throws parseexception ...{
Calendar Cal = calendar. getinstance ();
System. Out. println (Cal. getclass ());
}
Class java. util. gregoriancalendar
Relation material:
Public static calendar getinstance ()
...{
Calendar Cal = createcalendar (timezone. getdefaultref (), locale. getdefault ());
Cal. sharedzone = true;
Return Cal;
}
Private Static calendar createcalendar (timezone zone,
Locale alocale)
...{
// If the specified locale is a Thai locale, returns a buddhistcalendar
// Instance.
If ("th". Equals (alocale. getlanguage ())
& ("Th". Equals (alocale. getcountry ())))...{
Return new sun. util. buddhistcalendar (zone, alocale );
} Else if ("JP". Equals (alocale. getvariant ())
& "JP". Equals (alocale. getcountry ())
& "Ja". Equals (alocale. getlanguage ()))...{
Return new japaneseimperialcalendar (zone, alocale );
}
// Else create the default calendar
Return new gregoriancalendar (zone, alocale );
}
Public gregoriancalendar (timezone zone, locale alocale )...{
Super (zone, alocale );
Gdate = (basecalendar. Date) Gcal. newcalendardate (zone );
Settimeinmillis (system. currenttimemillis ());
}
// Reference to the sun. util. Calendar. Gregorian instance (Singleton ).
Private Static final Gregorian Gcal =
Calendarsystem. getgregoriancalendar ();