As the title states, when does a method alter the value of a variable/argument of the parameter? ex:
public void someMethod(int a, int b){
a = 5;
b = 6;
}
//.. imagine a main method is written here..
{
int x = 23;
int y = 14;
someMethod(x,y);
System.out.println(x + " " + y);
}
When this is compiled, the result is 23 14 being printed. However, when are the values of the variables modified?
I know that it can be modified by usage of mutators (assuming that the argument passed is an object), but are there any other ways?