You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
663 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Indexer
{
class IndexerClass
{
private const int MAX = 10;
private string name;
private int[] data = new int[MAX];
public int this[int index]
{
get
{
if (index < 0 || index >= MAX)
throw new IndexOutOfRangeException();
return data[index];
}
set
{
if (!(index < 0 || index >= MAX))
data[index] = value;
}
}
}
}