MCQs
None.
output:
$ javac array_output.java
$ java array_output
i i i i i
Statements (1), (2), (3), and (4) are correct. (1) is correct because when a floating-point
number (a double in this case) is cast to an int, it simply loses the digits after the decimal.
(2) and (4) are correct because a long can be cast into a byte. If the long is over 127, it
loses its most significant (leftmost) bits.(3) actually works, even though a cast is not
necessary, because a long can store a byte.
Boolean variable can contain only one of two possible values, true and false.
Unicode defines fully international character set that can represent all the characters found
in all human languages. Its range is from 0 to 65536.
Short occupies 16 bits in memory. Its range is from -32768 to 32767.