I am trying to use reflection to loop through an instantiated class objects public fields. I keep getting "Unhandled exception type NoSuchFieldException" . I have been following the article below. However I am new to Java & Relection. Could anyone point out my issue ?
Class<?> c = dto.getClass();
myfields = new Field;
myfields = c.getFields();
for(int i = 0; i < myfields.length; i++)
Field chap = c.getDeclaredField(myfield