Answer Posted / soft.narayan@gmail.com
This answer posted by me soft.narayan@gmail.com,If u have
any query please let me know......
Using an object like an array is called Indexer.
Indexer is similar to properties.Indexer is a collection of
set and get procedures.Indexer name must be "this" only.
One class can have only one indexer.
Syntax to create Indexer:
string s
public string firstname
{
set{ s=value;}
get (return s;}
}
string[] x=new string[5];
public string this[inti]
{
set {x[i]=value}
get { return x[i]}
}
}
| Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
What is a class level variable in c#?
What do you mean by casting a data type?
What is the base class from which all value types are derived?
How many types of interface are there in c#?
What is use of a HashTable in .NET?
What is task parallel library?
What is the best dependency injection c#?
Explain the difference between arraylist and array and in c#?
How do you inherit a class into other class in c#?
How to block a class from being inherited further?
What is the difference between field and variable in c#?
How long can a string be c#?
What is cookies in c# asp net?
What is the use of functional interface?
Why do we overload constructors?