+1 vote
i don't undertstand the reflection concept.can any one explain reflection concept with example program??
asked May 4, 2016 in Computer Science - IT by gypsiii | 17 views

1 Answer

+1 vote
Best answer

In simple words reflection is a namespace in .net which provides us options to get informations about attributes of existing objects

Consider you are declaring an integer value as below :

int i= 10;

And you want to retrieve the properties of 'i' .

How can you achieve the output ?

Here we have reflection in action.

Namespace used for GetType is :

using System.Reflection;

Simple Example :

int i = 10;
System.Type type = i.GetType();

You get output as :


MSDN example :


answered May 4, 2016 by ppk
selected May 4, 2016 by gypsiii