It gives the error line at Method method= ReflectionAPI.class.getMethod(x, String.class);
When I run the code - it gives the below error
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
ReflectionAPI cannot be resolved to a type
use this. class name has to be same as method name
[code:ym0soz1r]package com.soapuitutorial.propertie;
import java.lang.reflect.Method;
public class Reflections {
public static void main(String[] args) throws SecurityException, NoSuchMethodException, ReflectiveOperationException
{
String x="SampleTest";
Method method= Reflections.class.getMethod(x, String.class);
method.invoke(method, "Hello");
}
public static void SampleTest(String x){
System.out.println("In SampleTest Method "+x);
}
}
[/code:ym0soz1r]