Recall that these are Java's fundamental data types:
byte --- very short integer,
uses 1 byte memory, value between -128 and 127
short --- short integer,
uses 2 byte memory, value between -32768 and 32767
int --- ordinary integer,
uses 4 byte memory, value between -2147483648 and 2147483647
long --- long integer,
uses 8 bytes memory, value
between -9223372036854775808 and 9223372036854775807
float --- single precision float,
uses 4 byte memory, absolute value between 1.4E-45 and 3.4E38
double
--- double precision float,
uses 8 byte memory, absolute value between 4.9E-324 and 1.8E308
char --- character
boolean --- true/false
All values of byte are also
values of short.
All values of short are also
values of int.
All values of int are also
values of long.
All values of long can be
approximated by values of float.
All values of float are also
values of double.
So....
If we have a short value
(say 30000), we can always
find the same
(or an approximate)
int value
BUT.... if we have a int value
(say 1000000), we MAY NOT ALWAYS
be able to find the same
(or an approximate)
short value !!!
Widening conversion converts a value from one type into another type
without causing a large error