Java Reflection : Interview questions

What is the use of Reflection?
How do you get a Class object?
How do you get information about the class like the name, type, parent class etc. ?

For answers , please read Inspect Java Class using Reflection

How to get the list of methods, fields and constructors of a class using Reflection?

For answer , please read Java Reflection: List All Constructors,Methods and Fields

How do you invoke methods and get and set fields values using Reflection?
How do you access private fields,constructors and methods of a class using Reflection?

For answers , please read Java Reflection: Access Private Constructors, Fields and Methods

How do you create an instance of a class using Reflection?

For answer , please read Java Reflection: Create Objects

Leave a Reply

Your email address will not be published. Required fields are marked *