Explore Library
Code QuizBeginner

Compound Assignment Typo

Spot the mistake in this counter increment.

Codejava
public class Counter {
    public static void main(String[] args) {
        int total = 10;
        total =+ 5;
        System.out.println(total);
    }
}

Why does 'total' print 5 instead of 15?