java toString for any object

Viewed 11360

I have a lot of data objects, and I want to be able to generate a String representing each object, without implementing a toString method for each one.

I'm thinking of reflection for getting the fields and its values.

any other ideas?

thanks.

8 Answers
Related