This question was just asked and answered by the same contributor on SO:
How do I print my Java object without getting "SomeType@2f92e0f4"?
His comment:
After much searching, I failed to find a canonical Q&A for such a core Java issue. I'm intending this to be the canonical question and will try to close several duplicates to point at this.
My understanding was that the appropriate action in this case should be to clean up an existing question. There is, in fact, an existing question for this issue:
How to print object content in correct way?
This question could be edited for clarity, a new answer could be added, or bounties could be awarded to encourage other participants to create better answers.
I question the appropriateness of creating a new question for the purposes of answering it, accepting your answer, and closing other questions to point to it.
... with out using toString method
seems irrelevant, and wasn't part of original question. It should probably be removed since it is causing only misunderstanding sincetoString
is correct answer to solve this problem.