1).ref型传递变量前,变量必须初始化,否则编译器会报错,而out型则不需要初始化 2).ref型传递变量,数值可以传入方法中,而out型无法将数据传入方法中。换而言之,ref型有进有出,out型只出不进。
ref关键字 在方法的输入参数前使用ref 则该方法对变量所做的任何改变都会影响原始对象的值
out关键字 在方法的输入参数前使用out 则传递给该方法的变量可以不初始化