Search
Sponsor
Winners

Win Prizes

Social Presence
Twitter Twitter LinkedIn YouTube Google

Like us on Facebook
Advertisements
Top Articles Author
Tue, 21-Oct-2014 Authors
All Time Authors
Vishal@Neeraj
38680
Rajkatie
20600
Bharathi Cherukuri
18040

Latest members | More ...


(Statistics delayed by 5 minutes)
 Interview Question

What is an INDEXER in c# ?

 Posted by Chvrsri on 3/22/2011 | Category: C# Interview questions | Views: 3644 | 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