posted 22 years ago
Q.......
Select the valid primitive assignments of the following.
A.int i = 10;
char c = i;
B.float f;
long l = 100L;
f = l;
C.short s = 20;
char c = s;
D.byte b = 20;
char c = b;
E.short s1 = 10;
short s2 = 20;
short result = s1*s2;
give answer is a & b.
but i can't compile both in jdk1.3.1,i think the cast is necessary!!
if i am wrong ,pls correct me!!thanks!