Hi Deepthi,
One can box and then widen
this is wrong.
you cannot first box and then widen:
or:
int i = 54321;
Long lo = i; // no compile
or verbose:
int i = 5;
Integer inti = i; // ok so far but
Long lo = inti; // no way!
But you can first widen and
then box.
or:
Here no two-liner is possible.
K&B book says somewhere "an int can never become a Long", or something like that. But this is not correct in general. It's only correct, if you try it in the short cut coding style like in my example with the 54321.
Yours,
Bu.