using System;
class Student
{
private string[] names = new string[10];
public string this[int index]
{
get {
return this.names[index];
}
set {
this.names[index] = value;
}
}
}
class Program
{
static void Main(string[] args)
{
Student s = new Student();
s[0] = "Dumbledore";
s[1] = "Rubeus";
s[2] = "Hermione";
Console.WriteLine(s[0]);
Console.WriteLine(s[1]);
Console.WriteLine(s[2]);
}
}
/*
run:
Dumbledore
Rubeus
Hermione
*/