1.

How method can be invoked on unknown object?(a) obj.getClass().getDeclaredMethod()(b) obj.getClass().getDeclaredField()(c) obj.getClass().getMethod()(d) obj.getClass().getObject()This question was posed to me in exam.Query is from Reflection API topic in division Session Management, JSP & API of Java

Answer»

The correct answer is (C) obj.getClass().getMethod()

For explanation: obj.getClass().getMethod is used to INVOKE a method on unknown OBJECT obj.



Discussion

No Comment Found

Related InterviewSolutions