The = operator stores a value in a variable. int x = 5; assigns 5 to x. The right side evaluates first, then the result moves into the left side. You can chain assignments: int a, b, c; a = b = c = 10; assigns 10 to all three.
Assignment returns the assigned value, allowing chaining. Assignment is not comparison. Writing if (x = 5) assigns 5 to x and treats the result as true, not checking equality. Use == for comparison.