I am a beginner Java programmer and I read about the Calendar class. This is an abstract class and all of its methods are static, but it is used as follows:
Calendar cal = Calendar.getInstance();
Where do you use cal to call methods like:
cal.setTimeinMillis(day1);
I am confused by this. When you call methods against a class, why do we need a reference variable and how is it legal for static methods?
source share