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 are the Types of values mode can hold session state in web.config
Why to use lock statement in c#?
How do you serialize in c#?
What is dbcontext c#?
What are access modifiers used for?
What is difference between write and writeline?
Explain the difference between abstract class and interface in .net?
how to print invert pyramid in c#
What are c# i/o classes?
Explain the top reason to use c# language?
Can we override interface method?
What is dependency in software?
Can interface inherit class in c#?
What is pure abstract class in c#?
What do you mean by saying a "struct is a value type"?