Win a copy of Clojure in Action this week in the Clojure 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
  • 0
  • 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: 33697
316
Eclipse IDE Java VI Editor
  • 0
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic