WHAT IS REFLECTION?
|Institute||Ahsanullah Institute of Information and Communication Technology 2013|
Reflection refers to code that is able to inspect itself or some other code in the system. In static typing system language such as Java, we cannot call a method from which we know the name unless conforms to an interface that we already know.
Method method = foo.getClass().getMethod("doSomething", null); method.invoke(foo, null);
Abusing reflection can have an impact in terms of performance and stability, since classes need to be semantically analyzed and an object might expect a component in a class that might not exist