using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
class Array
{
public int[] p;
public int this[int i]
{
get
{
return p[i];
}
set
{
p[i] = value;
}
}
public Array()
{
p = new int[2];
}
}
static void Main(string[] args)
{
Array a = new Array();
a[0] = 1;
a[1] = 2;
}
}
}
C# 索引器和运算符的重载
最新推荐文章于 2023-11-16 20:52:00 发布