Is there any way to read and print the object attribute dynamically(Java) ? for example if I have following object
public class A{ int age ; String name;
You can use reflection to get every field from your object (if security configuration allows you).
If you need it not for the sake of self-education, then it may be worth using ReflectionUtils from Apache Commons.