/ / load the classes

Class c = class.forname (” package name “) The field name “);

// Create an instance of the class

Object obj = c.neInstance();

// Get the attributes of the class

 

Filed[] fields = c.getDeclaredFileds(); // Can’t get private attributes in the class,

// If you want to get private attributes, restrict JVM access checks as follows:

fileds[i].setAccessible(true);

// Get the methods in this class

Method[]   methods = c.getDeclaration();