Small Java test

Here’s a small Java snippet


int sum = 0;
for(int i = 1; i <= 3; i++) {
  sum =+ i;
}
System.out.println(sum);

What should this code print?
1
3
6
Compilation error

Check Your Answer