Due Date: Wednesday, September 21, 2005, or Thursday, September 22, 2005, before the beginning of your lecture section.
Goal: the goal of this assignment is to learn how to deal with numbers in Java.
1. What will be the result of the following expressions:
(a) 4/2/8(b) 4.0/2.0/8.0
(c) a++ (if a was originally 10)
(d) --a (if a was originally 10)
2. Let b be a variable of type int. Use type casting to assign b's value to the following variables:
(a) shortB of type short
(b) doubleB of type double
Explain in which of these two cases we can use type conversion instead of type casting. If type conversion is possible, what is the advantage of type casting?