Mega Code Archive

 
Categories / Java Tutorial / Reflection
 

Getting the Methods of a Class Object

import java.lang.reflect.Method; public class Main {   public static void main(String[] argv) throws Exception {     Class cls = java.lang.String.class;     Method method = cls.getMethod("substring", new Class[] { int.class });     System.out.println(method);   } }