user594979
user594979

Reputation: 115

runtime datatype


what is runtime data type in c#-4.0/Vs-2010 ?
thanks.

Upvotes: 0

Views: 89

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039418

It is the actual type of a variable at runtime. For example:

IFoo foo = new Bar();

The compile time type of the foo variable is IFoo and the runtime is Bar. The runtime type can be obtained using the GetType method:

Type type = someInstance.GetType();

Upvotes: 3

Related Questions