c# 索引器重载
Prerequisite: Indexers in C#
先决条件: C#中的索引器
We can overload indexers in C#. We can declare indexers with multiple arguments and every argument have different data-types. It is not compulsory that indexes must be integer type. Indexes can be different types like string.
我们可以在C#中重载索引器 。 我们可以声明带有多个参数的索引器 ,并且每个参数都具有不同的数据类型。 索引必须为整数类型不是强制性的。 索引可以是不同的类型,例如字符串。
Example:
例:
using System;
using System.Collections;
namespace ConsoleApplication1
{
class Names
{
static public