Answer the question
In order to leave comments, you need to log in
Calendar cal = Calendar.getInstance(); returns GregorianCalendar, how can methods be executed in that case?
Calendar cal = Calendar.getInstance(); returns a GregorianCalendar, how then can the methods of GregorianCalendar be executed if java is looking at the methods of the reference variable and not at the referenced object?
And why use the construction Calendar cal = Calendar.getInstance(); instead of GregorianCalendar var = new GregorianCalendar() ?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question