Monday 2 April 2012

what is boxing


It is an implicit conversion of a value type to reference type. eg- int i=123; object o=i; // implicit boxing.


converting int to reference 


It is the conversion of the primitive data type to its related object so u can deal with it as an object it is like wrapper classes in java.






CONVERSION OF A VALUE DATA TYPE TO A REFERENCE DATA TYPE IS CALLED AS BOXING 


Boxing is to convert value type to reference type. 




Boxing:Any value type to be implicitly converted to Object Type. Dim x as Integer Dim y as Object x=10 y=x This is a Boxing process. 


Boxing is an implicit convertion of a value type to the type object. It means Boxing allows us to convert value types to reference type. 




Boxing permits any value type to be implicitly converted to type object or to any interface type implemented by value type 



No comments:

Post a Comment