reflection programming

Reflection programming is the ability of a process to examine, introspect, and modify its own structure and behaviour.
For example, say you have an object of an unknown type in Java, and you would like to call a 'doSomething' method on it if one exists. Java's static typing system isn't really designed to support this unless the object conforms to a known interface, but using reflection, your code can look at the object and find out if it has a method called 'doSomething' and then call it if you want to.
So, to give you a code example of this in Java (imagine the object in question is foo) :
```
Method method = foo.getClass().getMethod("doSomething", null);
method.invoke(foo, null);
```