I want to invoke the main method which is static. I got the object of type Class, but I am not able to create an instance of that class and also not able to invoke the static method main.
I want to invoke the main method which is static. I got the object
Share
In case the method is private use
getDeclaredMethod()instead ofgetMethod(). And callsetAccessible(true)on the method object.