Beginner
Is Java pass-by-value or pass-by-reference?
Reveal answer and example
Java passes values. For an object variable, that value is a reference: a method can mutate the referenced object, but rebinding its parameter does not rebind the caller's variable.
Example: A method can add to the caller's list, but assigning parameter = new ArrayList does not replace that caller's list.
Big O is not intrinsic to this conceptual question. Define the implementation, input size and operation before assigning a complexity.
Common mistake: Describing Java as pass-by-reference obscures the distinction between mutation and reassignment.
Follow-up: What happens when the referenced object is immutable?