1.

How to get the class object of associated class using Reflection?(a) Class.forName(“className”)(b) Class.name(“className”)(c) className.getClass()(d) className.getClassName()The question was asked in examination.The doubt is from Reflection API topic in chapter Session Management, JSP & API of Java

Answer» RIGHT option is (a) Class.forName(“CLASSNAME”)

The explanation is: forName(String className) returns the Class OBJECT associated with the class or INTERFACE with the given string name.


Discussion

No Comment Found

Related InterviewSolutions