1
JavaBeginner#fundamentals
Java is always pass-by-value. For objects, the value passed is a copy of the reference, so mutating the object's state through it affects the original, but reassigning the parameter does not affect the caller's reference.
void modify(StringBuilder sb) { sb.append("x"); sb = new StringBuilder("new"); }
StringBuilder s = new StringBuilder("a");
modify(s);
System.out.println(s); // "ax" — append worked, reassignment didn't