What are the valid parameter types we can pass in an
Indexer ?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / anjum rizwi
Hi Dileep,
Can you plz give me the example of indexer?
Is This Answer Correct ? | 1 Yes | 1 No |
Which framework is best for desktop application?
Why do we need static class in c#?
What is razor view in c#?
What namespaces are necessary to create a localized application?
2 Answers Rolta, Siebel Systems, Visual Soft,
Describe the overview of clr integration.
Is string passed by reference in c#?
Does hashset allow duplicates c#?
What is a c sharp?
What is an interface class in c#?
What is an arraylist in c#?
Enlist some of the properties of a thread class?
Define sealed classes in c#?