CSC207H1 Lecture Notes - Return Type, Methamphetamine, Metaprogramming
Document Summary
Reflection background: alan turing"s great insight: programs are just another kind of data, source code is text that is interpreted in a specific way, with certain conventions, compiled programs are data, too: Integers and strings are bytes in memory that you interpret a certain way. Instructions in methods are just bytes, too. Reflection: if programs are just data, we can write a program that treats another program as data. Any compiler or interpreter: we can also build reflection into our languages. Reflection is the ability of a program to treat itself as data. The class called class: instances of the class class store information about java classes (i. e. , types), such as. Class name, inheritance relationships, interfaces implemented, methods and members, etc: can look up the instance of class for a specific type by using the class name or an instance of the type.