Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
public class SampleCollection
{
private string[] data = new string[5];
public string this[int index]
{
get
{
return data[index];
}
set
{
data[index] = value;
}
}
}
class Program
{
static void Main()
{
SampleCollection collection = new SampleCollection();
collection[0] = "Apple";
collection[1] = "Banana";
collection[2] = "Mango";
for (int i = 0; i < 3; i++)
{
Console.WriteLine(collection[i]);
}
}
}Coding works best on desktop or with an external keyboard.