How are variables passed in Java methods? By reference or by value?
In Java, variables are passed by value, meaning a copy of the variableâ€™s value is passed to the method.
Excellent! You've understood how variables are passed in Java methods.
Can you explain what happens when a primitive type is passed versus when an object reference is passed?