Retrieve fields of a class Reflection Java

It is advised to read the notes on Java Reflection API before attempting the programs. Example on Retrieve fields of a class import java.lang.reflect.Field; public class Demo { public int price; public double rate; public String name; public static void main(String args[]) { Demo d1 = new Demo(); Class c = d1.getClass(); Field f[] = …

Retrieve fields of a class Reflection Java Read More »