Invoking a method

Report a typo

There is a class named SomeClass. You need to find its only method and invoke it without arguments.

class SomeClass {

    // there is a method
}

Your program must print out the result of the found method.

Write a program in Java 17
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

class MethodsDemo {

public static void main(String[] args) {
// write your code here
}
}
___

Create a free account to access the full topic