Getting the Field Objects of a Class Object There are three ways of obtaining a Field object from a Class object. Class cls = java.awt.Point.class; // By obtaining a list of all declared fields. Field[] fields = cls.getDeclaredFields(); // By obtaining a list of all public fields, // both declared and inherited. fields = cls.getFields(); for (int i=0; i