|
-
Oct 5th, 2009, 01:24 PM
#22
Re: [RESOLVED] Inheritance and Polymorphism
As I wrote it, I got thinking about Integers, which are value types. In general, we think of a variable that holds a value type as containing the actual value, while a variable holding a reference type holds the address of the actual value. If this were actually true, then Integers couldn't be objects...but they are. After a look at IL output, it is clear that an integer variable holds the integer, but it can be boxed into an object, if needed. So an integer doesn't really inherit from type Object, for the sake of efficiency, though it acts as if it does, for the sake of consistency.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|