An extension converts a primitive or non-primitive to a wider type (i.e. one that can contain more bytes).
Example:
short -> int String -> Object
But, int -> Integer does not expand; this is boxing. An extension has a higher priority than boxing. Also, both expansion and boxing cannot be performed together, i.e.
int -> Long // cannot be done - both widening and boxing int -> long // can be done - only widening
Avinash mishra
source share