ref是引用把值类型转换成弓用,out是输出,区别是ref是输入兼输出的,out只是单纯的输出 public void num(ref int num1, ref int num2){ } public void num(out int num1, out int num2){ }