Java Class getMethod() MethodThe getGenericSuperClass() method of java Class class returns a method object representing the specified public member method of the class or interface represented by this Class object. The name parameter is passed as a string. SyntaxParametername - the name of the method parameterTypes - list of parameters ReturnsThe Method object. ThrowsNoSuchMethodException , NullPointerException , SecurityException Example 1Test it NowOutput: method = public java.lang.Integer ClassgetMethodExample1.showMethod() method = public void ClassgetMethodExample1.showLongMethod(java.lang.Long) Example 2Test it NowOutput: public int ClassgetMethodExample2.IntCalc(int) public void ClassgetMethodExample2.Work() public static void ClassgetMethodExample2.StaticMethod(java.lang.String) public void ClassgetMethodExample2.Work()
Next TopicJava Class
|