Autoboxing:-
Autoboxing is automatic conversion of primitive data type to their object equivalents(or boxed primitive).
Autoboxing is converting a primitive value like "char" into object of the corresponding wrapper class like "Character". as example int into Integer,char into Character,boolean into Boolean etc.
Example:-
int a=10; Integer b=a;
Unboxing/Autounboxing:-
Unboxing is conversion of object reference into primitive data type.
unboxing is converting object of wrapper class like"Character" into primitive value as "char". As example Integer into int, Boolean into bolean etc.
Example:-
int c=b;
0 comments:
Post a Comment