What are the valid parameter types we can pass in an
Indexer ?
Answer Posted / guest
Hi,
This is Madhu from HYD..............
Indexer is same as property procedure.It provides array like
accessing.
Indexers are used to access the array of elements with
respect to object name. The name of Indexers always this.
Indexer can't be static.
EX:---
Public class demoindexer
{
int []a={10,20,30,40};
public int this[int index]
{
get
{
return a[index];
}
set
{
a[index]=value;
}
}
public static void main()
{
demo obj1;
obj1=new demo();
obj1.[0]--->10;
obj1.[1]--->20;
obj1.[2]--->30;
obj1.[3]--->40;
}
}
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
Why do we parse in c#?
How Global.asax is used ?
What is dependency in software?
3. Use layered architecture for coding. s.no name description 1 abc xxxxxxxxx 2 abc xxxxxxxxx 3 4 5 6 7 8 Select all Clear all Add Delete Name Description Save close
Explain the term inheritance in C#.
What are extension methods and where can we use them?
Are c and c# the same thing?
What is hierarchical inheritance in c#?
How to put assembly in gac?
Name the connections does microsoft sql server support?
Write down the c# syntax to catch an exception
What is the usage of OLE?
Illustrate race condition?
How does a while loop work?
What is the difference between CONST and READONLY?