G
Guest
Hi,
In some cases value type is expensive than class. For example:
class myclass(DataTime dateTime);
DataTime is a structure therefore a value type. If it is a reference type I
can do:
myclass aa = new myclass(null);
no memory located for DataTime instance. But because it is a value type, I
have to do
DataTime dd = new DataTime();
myclass aa = new myclass(dd);
now double DateTime instances are allocated and but I need none in this case.
My conclusion:
Because value type not really save memory. cancel it will be better.
In some cases value type is expensive than class. For example:
class myclass(DataTime dateTime);
DataTime is a structure therefore a value type. If it is a reference type I
can do:
myclass aa = new myclass(null);
no memory located for DataTime instance. But because it is a value type, I
have to do
DataTime dd = new DataTime();
myclass aa = new myclass(dd);
now double DateTime instances are allocated and but I need none in this case.
My conclusion:
Because value type not really save memory. cancel it will be better.