This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Depricated Date class

 
Ajit Kanada
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When Date class is depricated and all other classes are extending from date how to get Todays Date w/o calender?
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajit,
The Date class is depricated because the Calendar class is more general. The answer to your question seems to be that you can't. To get todays date you would use any Calendar subclass (i.e., GregorianCalendar):

Regards,
Manfred.
 
Matthew Jones
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just because a class is deprecicated doesn't mean you can't use it, it just means that a better way of doing the same thing was developed, and it will give you a depreciation message when you compile, but the code will still work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic