Quote: Original post by hpjchobbes
Question regarding the base 'object' and boxing/unboxing. Since every type inherits from the base 'object' type, would it be something similar to this?
*** Source Snippet Removed ***
It would be similar, except that the function would have the
override
marker, and I am not sure that those new functions are actually virtual. But you got the right idea.Quote: Original post by hpjchobbes
After typing this, it seems like object may even be using an interface, like so:
*** Source Snippet Removed ***
You're right, it could derive from interface, but in this instance what would be the point? Nothing else would ever derive from IObject, and object doesn't add any new method to IObject, so there seems to be little reason to do this.
Quote: Original post by hpjchobbes
Based on this, if you inherit a class from a class that implements an interface, does the derived class also have to implement the interface or only if they explicitly state they will implement the interface?
It's not that the derived class has to implement the interface, it already does implement the interface, because the derived class has all of the members of its base class.
Quote: Original post by hpjchobbes
If I understand this correctly, if I 'box' my int to an object {object o = (object)int} then I can only use the members of object, unless I cast (which unboxes or reboxes?)
*** Source Snippet Removed ***
That is correct.
EDIT: Doh! Too late. I am too slow.