This section explores you, how to retrieve the fields of the class by using the getFields() method. For this we are taking an example that provides the use of the getFields() method in detailed way.
Finding out the class fields
This section explores you, how
to retrieve the fields of the class by using
the getFields() method. For this we are taking an example that
provides the use of the getFields() method in detailed way.
Create a class "Ffield" and create an object of this class and assign it
the reference of java.util.Integer.class class. Now retrieve the class
fields by using the getFields() method.
Here is the code of the Example :
Ffield.java:
import java.lang.reflect.*;
|
Here is the output of the Example :
C:\roseindia>javac Ffield.java C:\roseindia>java Ffield CASE_INSENSITIVE_ORDER |