Increment Operator

The ++ operator, which adds one to a numeric variable.

What does Increment Operator do in Java?

Increment Operator — The ++ operator, which adds one to a numeric variable.

class Bakery {
    void divideCookies() {
        int cookies = 10;
        cookies++;
        int cookiesPerGuest = cookies / 2;
    }
}

Level: Novice · More Java terms at this level

Updated

In other subjects