Test your technical skills online, appear in Virtual Interview and be ready for job!
Twitter Twitter LinkedIn YouTube Google
Be Interview ready ! | Search
Make friends on DotNetFunda.com and expand your network!
Winners

Win Prizes

Announcements
Like us on Facebook
Sponsor
Top Articles Author
Wed, 16-Apr-2014 Authors
All Time Authors
Rajkatie
20480
Vishal@Neeraj
19600
Bharathi Cherukuri
18040

Latest members | More ...


(Statistics delayed by 5 minutes)

What is an INDEXER in c# ?

 Posted by Chvrsri on 3/22/2011 | Category: C# Interview questions | Views: 3176 | Points: 40
Answer:



Generally in C# Indexers are generally known as Smart Arrays.Defining a c# indexer is almost equal to defining properties.An indexer is a member which enables an object to be indexed in the same way as an array.


class IndexerDemo
{
private string []info = new string[5];
public string this [int index]
{
get
{
return info[index];
}
set
{
info[index] = value;
}
}
}


As shown above defining an indexer is much likely defining properties.


Asked In: Many Interviews | Alert Moderator 

Found interesting? Add this to:




Comments or Responses

Login to post response.

Comments / Responses
Select text & click toolbar to format. Formatting appears in viewmode only. HTML Tags are not allowed.
Bold Italic Underline Paragraph Title Code  Link 
 Wait ... Processing ..... please wait.