Question 46)
Given the following variables which of the following lines will compile without error?
String s = "Hello";
long l = 99;
double d = 1.11;
int i = 1;
int j = 0;
1) j=i<<s;>
2) j=i<<j;>
3) j=i<<d;>
4) j=i<<l;>
I think 4) is incorrect. Before shifting, variable i is promoted to long since l is a long variable, but j is still int. The long result can't assign to a int variable j. Right? Please comment.
Ada