Getting the Field Objects of a Class Object: By obtaining a list of all declared fields. : Field « Reflection « Java
- Java
- Reflection
- Field
Getting the Field Objects of a Class Object: By obtaining a list of all declared fields.
import java.lang.reflect.Field;
public class Main {
public static void main(String[] argv) throws Exception {
Class cls = java.awt.Point.class;
Field[] fields = cls.getDeclaredFields();
}
}
Related examples in the same category