Question: is apex pass by reference?
Answer: In Apex, all the primitive type variables are pass by value and all the object type variables are pass by reference. So, what does that mean? It means, when a parameter is passed into a function, if the parameter is of primitive type, Apex will make a copy of that variable can use that copy in the function.