Fiveable

💻AP Computer Science A Unit 1 Review

QR code for AP Computer Science A practice questions

1.6 Compound Assignment Operators

💻AP Computer Science A
Unit 1 Review

1.6 Compound Assignment Operators

Written by the Fiveable Content Team • Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examWritten by the Fiveable Content Team • Last updated September 2025
Pep mascot

Compound assignment operators are like keyboard shortcuts for programmers. Instead of writing score = score + 10, you can write score += 10. It does the exact same thing but with less typing and clearer intent. These operators combine a math operation with assignment in one neat package.

Once you start using compound assignment operators, regular assignment statements feel unnecessarily long. They're everywhere in real code because they make common operations more readable. When you're updating values based on their current state (which happens constantly), these operators are your best friends.

The increment and decrement operators (++ and --) take this concept even further. They're specifically designed for the super common task of adding or subtracting 1. You'll use these all the time in loops and whenever you're counting things.

  • Major concepts: Compound assignment operators (+=, -=, =, /=, %=), increment (++) and decrement (--) operators, evaluation order
  • Why this matters for AP: Essential for loop counters, appears in nearly every FRQ, common MCQ topic testing evaluation
  • Common pitfalls: Confusing x++ with ++x (only x++ is on the exam), forgetting that these operators change the variable
  • Key vocabulary: Compound assignment, increment, decrement, post-increment, post-decrement
  • Prereqs: Basic arithmetic operators, variable assignment, understanding of data types

Key Concepts

Pep mascot
more resources to help you study

Compound Assignment Operators - Math and Assignment Combined

The five compound assignment operators (+=, -=, =, /=, %=) perform an operation and assignment in one step. When you write total += price, it's exactly equivalent to total = total + price. The operator takes the current value, performs the operation with the right side, and stores the result back in the variable.

These operators work with all numeric types (int, double). The operation happens first, then the assignment. This means the variable must already exist and have a value - you can't use compound assignment to declare a variable.

What makes these operators so useful is they clearly show you're updating a value based on its current state. Code like balance -= payment immediately tells you that you're reducing the balance by the payment amount.

The += Operator - Most Common Compound Assignment

The += operator adds a value to a variable. It's probably the most frequently used compound assignment because accumulation is such a common pattern. Whether you're summing numbers, building up a total, or collecting points in a game, += is the tool for the job.

With numbers, it's straightforward: sum += num adds num to sum. But += also works with strings for concatenation! Writing message += "!" appends an exclamation point to the message. This versatility makes += especially important to master.

Remember that += creates a new string when used with strings (because strings are immutable), but with numbers it just updates the value. This distinction becomes important when considering memory and performance.

Increment and Decrement - Adding or Subtracting One

The ++ operator adds 1 to a variable, while -- subtracts 1. On the AP exam, you'll only see these in post-increment/post-decrement form: count++ or count--. These are equivalent to count += 1 and count -= 1 respectively.

The "post" in post-increment means the operation happens after the current value is used in any surrounding expression. However, the AP exam keeps it simple - you'll only see these operators by themselves, not embedded in complex expressions.

These operators only work with integer types (int, but technically also byte, short, long which aren't on the AP exam). You can't use ++ or -- with doubles or other types. They're designed specifically for counting, which is almost always done with integers.

Order of Operations with Compound Assignment

Compound assignment operators have the same precedence as regular assignment - they're evaluated last, after all arithmetic operations. This means in x = 2 + 3, the addition happens first (giving 5), then x is multiplied by 5.

The right side of a compound assignment is always fully evaluated before the operation is performed. If you have total += calculateTax(price), the method calculateTax is called first, then its return value is added to total.

This evaluation order is consistent and predictable, which helps avoid bugs. The compound assignment operator acts as a clear boundary - everything to its right is calculated first, then the operation is applied to update the variable.

Code Examples

Let's see compound assignment operators in action:

// Example: Basic compound assignment operators
public class ScoreTracker {
    public static void main(String[] args) {
        // Initialize variables
        int score = 100;
        double average = 85.5;
        int lives = 3;

        // Using += to add points
        score += 50;  // score is now 150
        System.out.println("Score after bonus: " + score);

        // Using -= to subtract
        score -= 25;  // score is now 125
        System.out.println("Score after penalty: " + score);

        // Using = to multiply
        score = 2;   // score is now 250
        System.out.println("Score after double multiplier: " + score);

        // Using /= to divide
        score /= 5;   // score is now 50
        System.out.println("Score after division: " + score);

        // Using %= for remainder
        score %= 15;  // score is now 5 (50 % 15)
        System.out.println("Score modulo 15: " + score);

        // Compound assignment with doubles
        average += 4.5;  // average is now 90.0
        average = 1.1;  // 10% increase, average is now 99.0
        System.out.println("New average: " + average);
    }
}

Here's how increment and decrement work:

// Example: Increment and decrement operators
public class Counter {
    public static void main(String[] args) {
        int count = 0;

        // Post-increment - adds 1
        count++;  // count is now 1
        System.out.println("After count++: " + count);

        count++;  // count is now 2
        count++;  // count is now 3
        System.out.println("After three increments: " + count);

        // Post-decrement - subtracts 1
        count--;  // count is now 2
        System.out.println("After count--: " + count);

        // Common loop usage
        System.out.println("Counting up:");
        for (int i = 0; i < 5; i++) {
            System.out.println("i = " + i);
        }

        // Using increment in while loop
        int x = 0;
        while (x < 3) {
            System.out.println("x = " + x);
            x++;  // increment at end of loop
        }
    }
}

String concatenation with +=:

// Example: String concatenation with +=
public class MessageBuilder {
    public static void main(String[] args) {
        String message = "Hello";

        // Build up a message
        message += " ";      // message is "Hello "
        message += "World";  // message is "Hello World"
        message += "!";      // message is "Hello World!"

        System.out.println(message);

        // Building a string in a loop
        String result = "";
        for (int i = 1; i <= 5; i++) {
            result += i;     // concatenates numbers as strings
            if (i < 5) {
                result += ", ";
            }
        }
        System.out.println("Numbers: " + result);  // "1, 2, 3, 4, 5"

        // Mixed types with +=
        String info = "Score: ";
        int points = 150;
        info += points;  // automatic conversion to string
        System.out.println(info);  // "Score: 150"
    }
}

Common Errors and Debugging

Using Compound Assignment Before Initialization

The variable must exist and have a value before using compound assignment:

// ERROR: Variable not initialized
int total;
total += 10;  // Compiler error: variable total might not have been initialized

// CORRECT: Initialize first
int total = 0;
total += 10;  // Now total is 10

This error occurs because compound assignment uses the current value. No current value means the operation can't be performed.

Type Mismatch with Compound Assignment

Be careful with type compatibility:

int score = 100;
score += 10.5;  // This actually works! Result is 110 (truncated)

double precise = 100.0;
precise += 10;  // This works too - int promoted to double

// But this doesn't work:
int count = 5;
count++;       // OK
double amount = 5.5;
amount++;      // ERROR: ++ only works with integers

The compound assignment operators handle some type conversions automatically, but ++ and -- are strictly for integers.

Forgetting That Operators Modify the Variable

A common mistake is forgetting that these operators change the variable:

int x = 5;
int y = x;
x += 3;  // x is now 8
System.out.println("x = " + x);  // 8
System.out.println("y = " + y);  // Still 5!

// The operators modify only the variable they're applied to

This is especially important when passing values to methods - the original variable is still modified.

Practice Problems

Problem 1: What does this code print?

int a = 10;
int b = 3;
a += b;
b = 2;
a -= b;
System.out.println("a = " + a + ", b = " + b);

Solution:

  • Initial: a = 10, b = 3
  • a += b: a = 13, b = 3
  • b = 2: a = 13, b = 6
  • a -= b: a = 7, b = 6
  • Prints: "a = 7, b = 6"

Problem 2: Build a string that displays a countdown:

// Complete this method
public static String countdown(int start) {
    String result = "Countdown: ";
    // Your code here
    return result;
}
// countdown(5) should return "Countdown: 5 4 3 2 1 Blast off!"

Solution:

public static String countdown(int start) {
    String result = "Countdown: ";
    for (int i = start; i > 0; i--) {
        result += i + " ";
    }
    result += "Blast off!";
    return result;
}

Problem 3: Fix this code that's trying to calculate compound interest:

double balance = 1000;
double rate = 0.05;  // 5% interest
int years = 3;

for (int i = 0; i < years; i++) {
    balance + balance  rate;  // ERROR: This line is wrong
}
System.out.println("Final balance: " + balance);

Solution: Change the error line to use compound assignment:

balance += balance  rate;  // Adds interest to balance
// Or equivalently:
balance = (1 + rate);      // Multiplies balance by 1.05

AP Exam Connections

Compound assignment operators appear frequently in the multiple-choice section. Common patterns include tracing through code with multiple compound assignments, especially in loops. Pay attention to the exact values after each operation.

For FRQs, you'll use these operators constantly:

  • FRQ 1 (Methods/Control): Loop counters almost always use i++
  • FRQ 2 (Class Design): Updating instance variables often uses compound assignment
  • FRQ 3 (Array/ArrayList): Accumulating sums with += is super common
  • FRQ 4 (2D Array): Nested loops mean lots of increment operators

Quick test tip: When you see compound assignment in an MCQ, work through it step by step. Write down the value after each operation. Don't try to do it all in your head - small arithmetic errors are easy to make under time pressure.

Remember that on the AP exam, you'll only see post-increment (x++) and post-decrement (x--), never the prefix versions. Also, these operators will appear alone, not embedded in complex expressions. This keeps things simpler and less error-prone.

Frequently Asked Questions

How do I write compound assignment operators in Java?

Use the shorthand operators just like the CED says: they do the operation on the right with the current value on the left, then store the result back in the left variable. Examples: - x += 5; // same as x = x + 5; - y -= 2; // y = y - 2; - n *= 3; // n = n * 3; - d /= 4; // d = d / 4; (watch integer division if d is an int) - r %= 7; // r = r % 7; For adding or subtracting exactly 1 use post-increment/post-decrement: - i++; // add 1 and store back - i--; // subtract 1 and store back Important AP details from the CED: compound assignments can do implicit narrowing (e.g., short s; s += 1; is allowed), and the AP scope excludes prefix ++/-- and using ++/-- inside other expressions (like arr[x++])—don’t use those on the exam. Review integer division and modulo behavior too. Want practice? Use the Topic 1.6 study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL) and over 1,000 AP CS A practice problems (https://library.fiveable.me/practice/ap-computer-science-a).

What's the difference between `+=` and just using `+` and `=`?

+= is a shorthand that does the operation and assignment in one step: x += y is equivalent to x = x + y in result for most cases, but there are two important differences you should know for AP CSA (EK 1.6.A): - Type narrowing: compound assignment does an implicit cast when the left variable has a smaller type. Example: short s = 1; s += 2; // compiles but short s2 = 1; s2 = s2 + 2; // won’t compile without (short) cast because s2+2 is int. - Readability and side effects: x += f() evaluates f() once (same as x = x + f()), but be careful if x appears inside f()—that can change behavior. Also post-increment rules (x++ ) are separate EKs. For quick AP review and examples, see the Topic 1.6 study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL). For extra practice problems, Fiveable’s AP CSA practice set is useful (https://library.fiveable.me/practice/ap-computer-science-a).

Why does `x += 5` give me a different result than `x = x + 5` sometimes?

Most of the time x += 5 and x = x + 5 do the same math, but they differ when the left-hand variable is a narrower primitive type (byte, short, char). In Java x + 5 is evaluated using int arithmetic, so the result is an int. A plain assignment x = x + 5 then needs an explicit cast back to the narrower type, or it won’t compile. But the compound operator (x += 5) does the operation and then implicitly narrows the result back to x’s type for you. Examples: - byte b = 10; b += 5; // OK (implicit narrowing) - byte b = 10; b = b + 5; // compile error: int cannot be assigned to byte without cast - byte b = 10; b = (byte)(b + 5); // works This is the “implicit narrowing conversion” behavior listed in the CED for Topic 1.6. For more examples and practice, check the Topic 1.6 study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL) and Unit 1 overview (https://library.fiveable.me/ap-computer-science-a/unit-1). For lots of practice problems, see (https://library.fiveable.me/practice/ap-computer-science-a).

What's the syntax for using `*=` and `/=` operators?

Compound assignment combines an arithmetic op with =. Syntax: - x *= y; // same as x = (type of x)(x * y) - x /= y; // same as x = (type of x)(x / y) Examples: - int a = 5; a *= 3; // a becomes 15 - double d = 10.0; d /= 4; // d becomes 2.5 - int b = 7; b /= 2; // b becomes 3 (integer division) Two AP-specific gotchas: - Integer division rules still apply: dividing two ints truncates toward zero (7/2 -> 3). If you want a fractional result, make one operand double. - Compound assignment performs an implicit narrowing cast to the left-hand variable’s type. For example, short s = 10; s *= 2.5; is allowed because the result is implicitly cast back to short. These operators are covered in EK 1.6.A.1 (compound assignment) and you’ll see them on Unit 1 materials (unit overview: https://library.fiveable.me/ap-computer-science-a/unit-1). For a short topic guide, check the study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL).

I'm confused about when to use `++` vs `+= 1` - are they the same thing?

Short answer: usually yes—but watch context. If you use the increment as a standalone statement, x++; and x += 1; (and x = x + 1;) do the same thing for Java numeric primitives: they add 1 and store the new value. Example: int x = 5; x++; // x is 6 Differences to remember (from the CED keywords EK 1.6.A.2 and EK 1.6.A.1): - The post-increment operator ++ is defined to add 1 to the stored value. When used by itself they’re equivalent to += 1. - Using ++ inside other expressions (e.g., arr[i++] or y = x++) is outside AP CSA scope—don’t rely on that on the exam. - Compound assignments (+=, -=, etc.) can perform implicit narrowing conversion in Java (e.g., byte b = 1; b += 1; compiles while b = b + 1; needs a cast). So += can be more permissive with smaller types. For more practice and a quick refresher see the Topic 1.6 study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL) and Unit 1 overview (https://library.fiveable.me/ap-computer-science-a/unit-1).

Can someone explain what `%=` does with an example?

The %= operator is a compound assignment that takes the remainder after division and stores it back in the left variable. It’s equivalent to x = x % y but evaluated only once on the left-hand variable (and may do an implicit narrowing conversion in Java). Example: int x = 17; x %= 5; // same as x = x % 5; System.out.println(x); // prints 2 because 17 divided by 5 leaves remainder 2 Use %= whenever you want to keep the remainder (useful for cycles, parity checks, or wrapping indices). On the AP CSA exam Topic 1.6, you should be able to read/write these and predict the stored value (LO 1.6.A, EK 1.6.A.1). For a quick refresher, see the compound assignment study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL) and try practice problems (https://library.fiveable.me/practice/ap-computer-science-a).

What's the difference between `x++` and `++x` and why can't I use `++x` on the AP exam?

x++ is the post-increment: it returns the current value, then adds 1 to the variable. ++x is the pre-increment: it adds 1 first, then returns the new value. Example: int x = 5; int a = x++; // a==5, x==6 int b = ++x; // b==7, x==7 On the AP CSA exam you should NOT use ++x (prefix) or use increments inside other expressions (like arr[x++])—the CED explicitly excludes prefix increment/decrement and usage inside expressions (see EK 1.6.A.2 and the exclusion statement). Stick to allowed forms: x++; x--; or compound assignments (x += 1, x -= 1, x = x + 1) used as standalone assignment statements. That avoids confusing evaluation-order/side-effect issues the exam won’t test. For extra practice on compound assignment and post-increment rules, check the Topic 1.6 study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL), the Unit 1 overview (https://library.fiveable.me/ap-computer-science-a/unit-1), and many practice questions (https://library.fiveable.me/practice/ap-computer-science-a).

How do I trace through code that uses compound assignment operators step by step?

Think of tracing compound assignments as three steps: rewrite, evaluate, assign. 1) Rewrite the compound form into the equivalent full assignment (EK 1.6.A.1): x += y → x = x + y x *= y → x = x * y, etc. 2) Evaluate the right-hand expression using current values (watch integer division and % behavior). If types differ, apply implicit narrowing/conversion rules before assignment. 3) Assign the computed result back to the left variable (this is the stored value you report). For post-increment/decrement (x++ / x--) remember they change the variable by ±1 but return the old value—and per the CED you only need to handle post-form when it’s a standalone statement (EK 1.6.A.2). Quick examples: - int a = 7; a /= 2; → rewrite a = a / 2; evaluate 7/2 = 3 (integer division); assign a = 3. - int b = 5; b %= 4; → b = b % 4 → 5 % 4 = 1 → b = 1. - int c = 4; c += 2 * 3; → c = c + (2*3) → c = 4 + 6 = 10. On the exam you may be asked to determine the stored value after a statement—show these steps (rewrite → evaluate RHS → apply type rules → assign). For a quick topic review check Fiveable’s study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL) and try practice problems (https://library.fiveable.me/practice/ap-computer-science-a) to solidify tracing skill.

Why am I getting weird results when I use `x++` inside an array like `arr[x++]`?

When you write arr[x++], Java uses the current value of x as the index, then increments x as a side effect. That’s fine by itself, but putting x++ inside other expressions or using x multiple times in one statement can produce surprising results because evaluation and the side effect happen in sequence. Example: y = arr[x++] + arr[x++]; first access uses x, then x becomes x+1, then second access uses the incremented x—not two reads of the same index. The AP CED explicitly says using ++ inside other expressions (like arr[x++]) is outside the exam scope because of these confusing side effects. To avoid bugs and be AP-safe, split it into clear steps: int idx = x; x = x + 1; val = arr[idx]; or val = arr[x]; x++; That follows EK 1.6 (post-increment behavior, side effects) and keeps your code readable. For a quick review, see the Topic 1.6 study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL) and Unit 1 overview (https://library.fiveable.me/ap-computer-science-a/unit-1). For more practice, try the AP problems (https://library.fiveable.me/practice/ap-computer-science-a).

When should I use compound assignment operators instead of regular assignment?

Use compound assignment whenever you want to perform an arithmetic operation on a variable and then store the result back into that same variable—it's just a shorter, clearer way to write it. For example x += 5 is the same as x = x + 5; use +=, -=, *=, /=, %= to make code more concise and reduce duplication (EK 1.6.A.1). Compound ops are especially nice in loops and accumulators (for counters, sums, products). Be careful about semantics AP tests care about: /= and % follow Java’s rules (integer division, modulo), and compound assignment can involve implicit narrowing conversions for smaller types. Also know post-increment/post-decrement (x++, x--) changes the stored value but using them inside other expressions is out of scope for the exam (CED exclusion). Practice spotting final stored values—that’s LO 1.6.A. For a short review and examples see the AP study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL). For more practice (1000+ problems), check (https://library.fiveable.me/practice/ap-computer-science-a).

What does `score -= 10` actually do to the variable `score`?

score -= 10; subtracts 10 from score and stores the result back into score. It’s exactly the same as writing score = score - 10;—the compound assignment performs the indicated arithmetic between the left-side variable and the right-side value, then assigns that new value to the variable (EK 1.6.A.1). So if score was 42 before, after score -= 10 it becomes 32. This works for numeric primitives (int, double, etc.), and if the types differ Java may perform an implicit narrowing or widening conversion as required by the compound assignment rules. Note this is different from the post-decrement operator (score--), which subtracts 1. For more practice and quick review of compound assignment operators on the AP CSA CED, see the Topic 1.6 study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL). If you want extra practice, Fiveable also has unit reviews and hundreds of practice problems (https://library.fiveable.me/ap-computer-science-a/unit-1 and https://library.fiveable.me/practice/ap-computer-science-a).

I don't understand how `remainder %= 3` works - can someone break it down?

Think of remainder %= 3 as shorthand for remainder = remainder % 3. The % operator (modulo) gives the remainder after division. So if remainder is 10, remainder %= 3 computes 10 % 3 (which is 1) and assigns 1 back into remainder. It’s a compound assignment (EK 1.6.A.1): do the operation between left and right, then store the result on the left. Important AP details: % works on integers the way you expect (10 % 3 → 1; 7 % 5 → 2). For negatives, Java keeps the sign of the left operand (e.g., -7 % 3 → -1), so be careful on exam questions. This is a simple assignment statement with a side effect—the variable on the left is updated. Practice spotting values after compound assignments for LO 1.6.A on the AP exam (see the Topic 1.6 study guide on Fiveable (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL)). For more practice problems, check Fiveable’s AP CSA practice set (https://library.fiveable.me/practice/ap-computer-science-a).

Are there any rules about using `++` and `--` operators that I need to know for the AP exam?

Short answer: yes—but the AP course keeps it simple. The CED only expects you to know the post-increment (x++) and post-decrement (x--) used as standalone assignment statements that add or subtract 1 from a numeric variable and store the new value. Important rules to remember for the exam: - Only post-form is in scope: x++ and x--. Prefix (++x/--x) is outside AP scope. - Don’t use ++ or -- inside other expressions (e.g., arr[x++], y = x++ + 2)—that usage is excluded from the course and exam. - They operate on numeric primitive variables and have the side effect of changing the variable’s stored value by ±1. - If you need combined arithmetic, use compound assignment operators (+=, -=, etc.) or explicit assignment so behavior is clear. For more review see the Topic 1.6 study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL) and Unit 1 overview (https://library.fiveable.me/ap-computer-science-a/unit-1). For extra practice, Fiveable has 1000+ AP CSA problems (https://library.fiveable.me/practice/ap-computer-science-a).

How do compound assignment operators work with different data types like `int` and `double`?

Compound assignments do the operation then store the result in the left-side variable, but Java handles types specially: the result is implicitly narrowed to the left operand’s type. That means: - If left is int and right is double: a += b computes (left + right) then narrows/casts to int. Example: int a = 5; a += 2.5; // 5 + 2.5 = 7.5 -> narrowed to 7 (no compile error) - If you write the long form a = a + 2.5, that’s a compile error because a + 2.5 is double and you’re assigning to int without a cast. - If left is double and right is int: double d = 5.0; d += 2; // 7.0—no narrowing needed. - Watch integer division and expressions: int i = 5; i += 2/3; // 2/3 is int 0, so i unchanged. If one operand is double, division is double before narrowing. Remember post-increment/decrement (x++/x--) adds/subtracts 1 and is in scope for this topic (prefix form ++x is outside AP CSA scope). For more examples and AP-style practice, see the Topic 1.6 study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL) and Unit 1 overview (https://library.fiveable.me/ap-computer-science-a/unit-1). Practice problems there help solidify these cases.

What's the order of operations when using compound assignment operators in expressions?

Short answer: evaluate the right-hand expression first, perform the indicated arithmetic using the current left-hand value, then (if needed) implicitly cast the result to the left-hand variable’s type and store it back. Details that matter for AP CSA (CED-aligned): - Operators: +=, -=, *=, /=, %= do "left = left right" but with two differences: the right-hand side is fully evaluated before the operation, and Java performs an implicit narrowing conversion back to the left variable’s type if needed (e.g., short s; s += 2; is allowed even though s+2 would be int). - Post-increment/decrement (x++, x--) change the stored value by ±1; they return the old value but then update the variable. Note the CED excludes prefix ++ and using ++/-- inside other expressions on the exam, so expect simple uses. Examples: int a=5; a += 3*2; // rhs 3*2 = 6, a becomes 11 short s = 1; s += 2; // s becomes 3 (implicit cast) For more practice and a concise topic guide, see the Fiveable study guide (https://library.fiveable.me/ap-computer-science-a/compound-assignment-operators/study-guide/JiszeHqK8F9G6gszbgPL) and try problems at (https://library.fiveable.me/practice/ap-computer-science-a).