reflection / reflective programming

Reflection refers to the ability for your code to examine attributes / methods about an object. For example, type(obj) returns the type of the object and then you can do stuff accordingly as per the object type.

In Java, you have getMethod('method name') to get an instance of a method from an object, so you can run the method. Note that you may not even have the method defined yet in that object, but the getMethod() function enables the compiler to pass because you are not directly calling the method.

So this ability to find an object's attributes and methods is a bit like reflecting on itself so it is called reflective programming.