1.

How private method can be called using reflection?(a) getDeclaredFields(b) getDeclaredMethods(c) getMethods(d) getFieldsThe question was posed to me during an interview.This key question is from Reflection API topic in chapter Session Management, JSP & API of Java

Answer»

Correct choice is (B) getDeclaredMethods

Easiest explanation: getDeclaredMethods gives INSTANCE of java.lang.reflect.Method.



Discussion

No Comment Found

Related InterviewSolutions