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 default method in c#?
Define thread?
Define an escape sequence, name few strings in escape sequence?
What is throw in c#?
What is the difference between values and reference types?
What is difference between .net and c#?
What do you mean by delegates and explain different types of delegates?
How to achieve polymorphism in c#?
What are types in c#?
In which way you can convert a value-type to a reference-type?
Is it possible to have different access modifiers on the get/set methods of a property in c#?
What is the use of 0 in c#?
how to print invert pyramid in c#
What are the applications of c#?
Explain how to add controls dynamically to the form using c#.net.