Question on boxing

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?
 
H

Hans Kesting

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top