Reflection is the process by which a program can observe and modify its own structure and behavior at runtime.
Reflection is the process by which a program can perform introspection. This introspection usually involves the ability to observe and modify its own structure and behavior at runtime. From theoretical perspective reflection relates to the fact that program instructions are stored as data. The distinction between program code and data is a matter of how the information is treated. Hence programs can treat their own code as data and observe or modify them.