Java中方法参数的总结(call by value):
1、一个方法不能修改一个原语类型的参数;
2、一个方法可以改变一个对象参数的状态;
3、一个方法不能让一个对象参数指向一个新对象;
原文如下:
• A method cannot modify a parameter of a primitive type (that is, numbers or boolean values).
• A method can change the state of an object parameter.
• A method cannot make an object parameter refer to a new object.