and I got the same answer as the book, 4 3. However, I don't understand why the answer is not 3 3. Since s is of type Short, couldn't you box short to Short, then widen Short to Integer? The only answer I can think of is maybe because Short is now an object not a primitive, it is a subclass of Number, not Integer? Is that correct?
posted 9 years ago
you can widen from short to int, but not from Short to Integer, so your reckoning is correct