10.1.2 - Returning values of different types from a method - Point 2 Autoboxing/Unboxing |
---|
Java allows a return value to be a reference to a wrapper class if the return type is of a primitive type of the same or smaller type.
...
The reverse is also allowed:
![]() |