import java.lang.reflect.*; public class Refl7 { public static void main(String args[]) throws Exception { Class cls= Class.forName(args[0]); Field first[]=cls.getDeclaredFields(); for(int i=0;i<first.length;i++) { Field f=first[i]; System.out.println("Name"+f.getName()); System.out.println("classname"+f.getDeclaringClass()); System.out.println("Type"+f.getType()); int mod=f.getModifiers(); System.out.println("Modifiers="+Modifier.toString(mod)); System.out.println("------"); } } }