How to print the values of all the fields of an object in Java
I was just doing some Java coding and I needed to check the values of a bunch of fields of an object (mostly numbers). Normally I’d just call and print each get() method if I just need to check a few fields, but the class I’m dealing with has over 30 fields and I need to check them all and there’s no way I’m doing over 30 print statements for each get() method!
A quick …