Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what if i print an object without specifing its felds to be printed?????

 
Deepakk Verma
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i write this code


it is giving me result as

myboxBox@19821f


can you tell me why?
(i know this code is of no use but i was curious to know why is it generating this output)

please explain....
 
Rahul P Kumar
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Follow this link. If you want meaningful print, you need to override toString() of Object (object with capital O) class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic