Boxing and Unboxing
BOXING AND UNBOXING IN.NET :-
For understanding Boxing and Unboxing 1st we should know about the Value type and Refrence type :-
VALUE TYPE AND REFRENCE TYPE :-
Value type:- value type hold the value within its own memory which allocated to the stack.
and its create a fresh memory for every data .
value type are int ,char ,float, string etc
Refrence type :- Refrence type does not store its value directly. its store the address where the value is being store .
Refrence type are object and its store in heap
BOXING AND UNBOXING :-
Boxing :- Boxing type is a process which can convert value type into the Refrence type
Eg :-
UnBoxing :- Unboxing is a process which can convert refrence type into value type by using TypeCasting
Eg:-
Comments
Post a Comment