Passing Parameters
Passing Parameters by Value
Parameters are passed by value (not by reference) to methods.
Through this, the argument value is passed to the parameter.
The following program shows an example of passing parameter by value.
The values of the arguments remain the same even after the method invocation:
Swapping by Using Objects
Java does not support the method of calling by reference.
The following script tries to bypass the limit by using objects to swap two values: