Wednesday 19 August 2015

What is difference between Boxing and UnBoxing

                     The process of converting the value types to reference types is known as Boxing.
                                 example:  int x=100; //stored to stack;
                                                 object obj=x; //stored to heap.
                     The Reverse of the boxing i.e converting reference type to value type is called as UnBoxing.
                                   example : int y=(int)obj;
       

1 comment: