1.值参数:
这种方式复制参数的实际值给函数的形式参数,实参和形参使用的是两个不同内存中的值。
在这种情况下,当形参的值发生改变时,不会影响实参的值,从而保证了实参数据的安全。
2.引用参数
这种方式复制参数的内存位置的引用给形式参数。这意味着,当形参的值发生改变时,同时也改变实参的值。
引用参数表示与提供给方法的实际参数具有相同的内存位置