Re: Boxing and Unboxing ??

Tech-Archive recommends: Fix windows errors by optimizing your registry




| >
| Ah so the boxing and unboxing overhead that does not cost very much

It can cost a lot, if you use it in a loop it can count for a big chunk of
the process.


| adds a lot of versatility to the underlying functionality while
maintaining type safety.

Maintaining type safety how?
In reality you lose the type safety, when you box an int for example you
will get an object reference, you could try to cast it to any other type and
get an error, unfortunately this error will be detected at runtime and not
at compile time. so it does not help but quite the opposite.

|It
| is comparable to the slight extra overhead that polymorphism requires yet
| providing much more versatile code.

Not at all, they are two very different things.


--
Ignacio Machin
machin AT laceupsolutions com


.