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 the difference between first and firstordefault?
What is collection of classes in c#?
Is double a decimal?
Which operator cannot be overloaded in c sharp?
So let's say I have an application that uses myapp.dll assembly, version 1.0.0.0. There is a security bug in that assembly, and I publish the patch, issuing it under name myapp.dll 1.1.0.0. How do I tell the client applications that are already installed to start using this new myapp.dll?
What is the use of main method in c#?
Illustrate namespaces in c#?
What is call back method?
Where do we set the min and max pool size for connection pooling?
What is lock statement in C#?
State the top.NET class that everything is derived from?
How do I create a dbml file?
What's the difference between system.string and system.text.stringbuilder classes?
How many keyword present in C# language ?
What is the use of static members with example using c#.net.