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 class method c#?
Are c# destructors the same as c++ destructors?
What is array formula?
Are arrays immutable c#?
What is orm in c#?
What is generic method in c#?
Is c# strongly typed?
Can we have 2 main methods in c#?
What is the system namespace?
What is executereader in c#?
What is difference between assembly and dll?
How do I move from one form to another in c#?
Define Virtual folder?
In which way you can convert a value-type to a reference-type?
What is int16?