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 |
How?s method overriding different from overloading?
What is a reference type c#?
What are the two keywords used to pass a variable by reference in c#?
What are the basics of c#?
What are console applications used for?
i want display a given number into Rupees Format Like Given number is : 156735 my Expected output is 1,56,735. how to display?
Can we return two values from a function?
Can u create multiple threads of execution ?
1 Answers IBM, ITC Infotech, UHU,
How long does it take to learn c# for unity?
Write an expression which satisfies the following statements: (i) Creates an object of type q (ii) If m is null, returns n, otherwise returns m (iii) If x and y are string types, it concatenates x and y
What is this keyword in C#?
What is parallel foreach in c#?