如果我们想从方法中获取值,我们可以使用返回值,如下所示:
public int GetValue();
要么:
public void GetValue(out int x);
我真的不明白它们之间的差异,所以,不知道哪个更好.你能解释一下这个吗?
谢谢.
c# reference
c# ×1
reference ×1