How does Calendar.getInstance() method get you the current year? It doesn’t read it from your computer obviously neither from the internet. This may sound like a newbie question but how does this method work?
How does Calendar.getInstance() method get you the current year? It doesn’t read it from
Share
Actually, it does read it from your computer. Internally, it calls
GregorianCalendar‘s constructor, which callsSystem.currentTimeMillis(), which is a native method.Depending on your locale, it might also create a
JapaneseImperialCalendaror aBuddhistCalendar, which also both callSystem.currentTimeMillis().