java.lang.Class.getMethods()


java.lang.Class.getMethods()

package com.codingdict;



import java.lang.reflect.*;



public class ClassDemo {



   public static void main(String[] args) {



      try {

         Class cls = Class.forName("java.awt.Label");

         System.out.println("Methods =");



         /* returns the array of 方法 objects representing the public 

            methods of this class */

         方法 m[] = cls.getMethods();

         for(int i = 0; i < m.length; i++) {

            System.out.println(m[i]);

         }

      } catch (Exception e) {

         System.out.println("Exception: " + e);

      }

   }

}