By Team Escalera
on 31 Oct 2017 03:13 PM
  • asp .net training in lucknow, C# basic concepts, learn c#
0 comments

This is a sample program in C#(sharp) :

The get and set accessors can be used for  defining an indexer.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

 

namespace EscaleraT

{

class Program

{

class Clients {

private string[] names = new string[10];

public string this[int index] {

get {

return names[index];

}

set {

names[index] = value;

}

}

}

static void Main(string[] args)

{

Clients c = new Clients();

c[0] = “Manish”;

c[1] = “Rajat”;

 

Console.WriteLine(c[1]);

}

}

}

If you want professional training in C#(sharp) you can join our training course : http://escaleratechnologies.com/Courses/internship-in-lucknow.aspx

Comments (0)

Leave A Comment