Java Class getMethod() Method

The 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.

Syntax

Parameter

name - the name of the method

parameterTypes - list of parameters

Returns

The Method object.

Throws

NoSuchMethodException , NullPointerException , SecurityException

Example 1

Test it Now

Output:

method = public java.lang.Integer ClassgetMethodExample1.showMethod()
method = public void ClassgetMethodExample1.showLongMethod(java.lang.Long)

Example 2

Test it Now

Output:

public int ClassgetMethodExample2.IntCalc(int)
public void ClassgetMethodExample2.Work()
public static void ClassgetMethodExample2.StaticMethod(java.lang.String)
public void ClassgetMethodExample2.Work()

Next TopicJava Class




Latest Courses