Type Casting:
Assume the following declarations:
int integer;double preciseReal;float sloppyReal;long bigInteger;
Rewrite those of the following statements which would generate a compile-time error using an appropriate cast that makes the error go away. Do not provide a cast for any statement which the compiler automatically promotes.
a)
integer = preciseReal;
b)
bigInteger = sloppyReal;
c)
preciseReal = integer;
d)
sloppyReal = bigInteger;
e)
integer = sloppyReal;
f)
biglnteger = preciseReal;
g)
sloppyReal = integer;
h)
preciseReal = biglnteger;
i)
integer = biglnteger;
j)
sloppyReal = preciseReal;
k)
preciseReal = sloppyReal;
l)
bigInteger = integer;
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.