+ 4
What is reflection ?
what is its practical use?
2 ответов
+ 22
By using Reflection in C#, one is able to find out details of an object, method, and create objects and invoke methods at runtime. The System.Reflection namespace contains classes and interfaces that provide a managed view of loaded types, methods, and fields, with the ability to dynamically create and invoke types :-D
+ 1
Let me illustrate with an example:
For example you want to execute code that you don't know what it is before compilation. The user decides.
C# not only supports that but also have dynamic keyword with which you can simply use dynamic features of C# without using reflection. It's lot more easier to work with.