Question on boxing

  • Thread starter Thread starter Mr Flibble
  • Start date Start date
M

Mr Flibble

Is boxing using object the same as the use of variant in VB?

Is it used to de-typify a variable, which must then later be cast back
to it's original type?
 
Is boxing using object the same as the use of variant in VB?
Is it used to de-typify a variable, which must then later be cast back
to it's original type?

The term "boxing" specifically refers to "change a *value-type* into a
reference type", as in storing an 'int' as an 'object'.
Later on you will want to "unbox" it, by casting to the *exact* type.

Hans Kesting
 
Back
Top