Abhimanyu Aryan

Abhimanyu Aryan

  • NA
  • 35
  • 8.6k

I don't understand Reflection in C#

Jun 22 2015 12:52 AM
On MSDN Reflection is explained as "You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object and invoke its methods or access its fields and properties. "
 
 
 As an example they have stated: 
 
int i = 42; 
System.Type type = i.GetType(); 
System.Console.WriteLine(type); 
 
 
If I am not wrong according to definition they have dynamically create 'type' object here and stored 'i.GetType()' return value in type. Is that what's reflection?
 

Answers (1)