Hi, i am confused by the primitive assignment. Can someone explain to me? Here is one example:
Question 56.
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;
The answer given is A and B. But when i compile a
test, only B doesn't give error message. And i am confused by JSL 5.2 Assignment conversion. Please throw a light on it.