"" .NET, , Object. .NET Object :
int myint = 0;
object myIntAsRefType = myInt;
You can do this with other reference types too:
Random rnd = new Random();
object rndAsObject = rnd;
Before you can use any of your own methods or properties, you must remove them:
if(myIntAsRefType is int)
int myNewInt = myIntAsRefType as int;
As an alternative:
if(myIntAsRefType is int)
int myNewInt = (int)myIntAsRefType;
source
share