With me, what you see is what you get. Yes, call me naive, but I love life. I am happy, and for that, I make no apologies. I do like to see the best in people, and when someone is nice to my face, I tend to believe them.
Source code:: import java.lang.reflect.*; public class Reflection { public static void main(String args[]) { try { System.out.println("enter the method name"); Class c = Class.forName(args[0]); Method[] m = c.getDeclaredMethods(); for(int i=0;i<=m.length;i++) { System.out.println(m[i]); } System.out.println("enter the name of class"); Constructor[] con = c.getDeclaredConstructors(); for(int i=0;i<con.length;i++) { System.out.println(con[i]); } System.out.println("enter the name of class"); Field[] f = c.getDeclaredFields(); for(int i=0;i<f.length;i++) { System.out.println(f[i]); } } catch(Exception e) { System.out.println(e); } } } // you can able to find the methods ,constructors,and fields of your desirable class. //for more program mail me on - er.gauravsrivastava.cse@gmail.com
Comments
Post a Comment