Multiple choice technology programming languages

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;

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The left shift operator (<<) requires integer operands. Option B compiles because both i and j are int types, so i<

AI explanation

The line j = i<