What is reflection, and why is it useful?
I\'m particularly interested in Java, but I assume the principles are the same in any language.
As per my understanding:
Reflection allows programmer to access entities in program dynamically. i.e. while coding an application if programmer is unaware about a class or its methods, he can make use of such class dynamically (at run time) by using reflection.
It is frequently used in scenarios where a class name changes frequently. If such a situation arises, then it is complicated for the programmer to rewrite the application and change the name of the class again and again.
Instead, by using reflection, there is need to worry about a possibly changing class name.