Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question about GregorianCalendar class  RSS feed

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

If I create a GregorianCalendar object like that:

GregorianCalendar date = new GregorianCalendar();

Are we sure that date contains the today date?
if not, how could we force the created object to contain the today date?

Best Regards
 
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public GregorianCalendar() constructs a default GregorianCalendar using the current time in the default time zone with the default locale.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!