This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Date instance printing the date without calling toString() method

 
upanshu vaid
Ranch Hand
Posts: 83
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
In this below code when I am passing the date object to S.O.P I am getting the output as current date and time , I wondered why this output is coming because this should print the hashcode of the object because I didn't override the toString method of object class.


Kindly clear my doubt on this.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34422
347
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some classes implement toString() directly. You can see in the JavaDoc that Date is one of them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic