Tuesday, November 11, 2014

How to simply print object content to String in Java

During development, you may frequently want to dump a Java object's all contents into a String for debug and  log.  You object has  fields  of primitive data type as well as List and Set. In java, dump a object to a more meaningful String will need you to override the toString() method. It's a bad practice to assemble the output string by hand, which is tedious and difficult to...
Powered by Blogger.

About The Author

My Photo
Has been a senior software developer, project manager for 10+ years. Dedicate himself to Alcatel-Lucent and China Telecom for delivering software solutions.