public int this[int x, int y]
{
get { return (x + y); }
}
最佳答案
这是一个 indexer接受两个整数。您可以将其视为类似于二维数组,只是结果是动态计算的而不是存储的。
它允许您编写 int result = foo[a, b];
关于c# - 此 C# 代码的含义是什么,我该如何使用它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3768614/