adplus-dvertising
frame-decoration

Question

What does foo.getClass().getMethod(“doSomething”, null) return?

a.

doSomething method instance

b.

Method is returned and we can call the method as method.invoke(foo,null);

c.

Class object

d.

Exception is thrown

Posted under Java Programming

Answer: (b).Method is returned and we can call the method as method.invoke(foo,null);

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What does foo.getClass().getMethod(“doSomething”, null) return?