-
What does foo.getClass().getMethod(“doSomething”, null) return?
-
- Exception is thrown
- Class object
- Method is returned and we can call the method as method.invoke(foo,null);
- doSomething method instance
- None of these
Correct Option: C
foo.getClass().getMethod() returns a method and we can call the method using method.invoke();