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.
Reflection gives you the ability to write more generic code. It allows you to create an object at runtime and call its method at runtime. Hence the program can be made highly parameterized. It also allows introspecting the object and class to detect its variables and method exposed to the outer world.