What is the difference between these two. I know Boxing is converting primitive values to reference. What is widening. Also what should be the sequence first boxing should b
Widening is when assign byte
to int
. i.e. you are widening the data type.
Sequence must be boxing
then widening
.
You CANNOT widen then box (int cannot be Long).
You CAN box then widen (int can become Object via Integer)
Note: Highlighted words are from Sun Certified Java Programmer SCJP 6 - Kathy Sierra