Hacker News new | ask | show | jobs
by steveklabnik 4388 days ago
Oh, duh, of course that's true. For some reason "the parent class of every class" is different than "a type explicitly for any type" in my brain.
1 comments

>For some reason "the parent class of every class" is different than "a type explicitly for any type" in my brain.

Good, because types and classes are different things despite what languages like Java and my beloved C# would have us to think.

To clarify:

"Object" as in Java is a type for any tagged box type. Primitives, such as "int", don't derive from Object, but can be promoted to a corresponding boxed type, such as "Integer".

The story is a little more complex in C#, where ValueType derives from Object and "value types", both primitive and user-defined, are truly subclasses of Object. Types not derived from ValueType are considered reference types.