View Single Post
Old 01-21-2009, 11:33 PM   #4 (permalink)
BobLewiston
 
Junior Techie

Join Date: Nov 2008

Posts: 79

BobLewiston is on a distinguished road

Default attention, jaeusm:

In your opinion, does the following seem to indicate that some data types are NOT objects? It’s from
Boxing and Unboxing (C#) :

Boxing and Unboxing (C# Programming Guide)

Boxing and unboxing enable value types to be treated as objects. Boxing a value type packages it inside an instance of the Object reference type. This allows the value type to be stored on the garbage collected heap. Unboxing extracts the value type from the object. In this example, the integer variable i is boxed and assigned to object o.
Code:
int i = 123;
object o = (object)i;  // boxing
The object o can then be unboxed and assigned to integer variable i:
Code:
o = 123;
i = (int)o;  // unboxing

BobLewiston is offline