Win a copy of Practical SVG this week in the HTML/CSS/JavaScript 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.
 
Liar, liar, pants on fire! refreshing plug:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!