0

Coming from JavaScript, I find it surprisingly hard to do so. In JS it was as easy as writing object's name in console. One way is to override toString(). But it is too tedious since I have to print all the instance variable separately? Am I right? If yes, is there another way?

dasfdsa
  • 7,102
  • 8
  • 51
  • 93

1 Answers1

0

Yes you right, but you can use some tools for override toString method easily, for example ToStringBuilder method reflectionToString

Aleksandr Podkutin
  • 2,532
  • 1
  • 20
  • 31