The essence of the question is this. There is a certain class:
public class TestClass { private static final int i = 9; private int[] array = {1, 4, 9}; private Object[] array2 = {new Date(), new Date()}; } Next, do the following:
Field[] fields = TestClass.class.getDeclaredFields(); for (Field field : fields) { System.out.println(field.get(new TestClass())); } Here we get an array in which the fields of our class lie. Next, we need to display the values of these fields. But if we have a field - an array, then we need to display all the elements of this array, and not the link. How to do it?