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 to run the program at particular time? It should run everyday at 3:00 PM. After executing the program should sleep until next day at 3:00 PM. Please explain with code?
What is the implicit name of the parameter that gets passed into the set method/property of a class?
What are the types of comment in c# with examples?
How can we set the class to be inherited, but prevent the method from being over-ridden?
How will you deploy the dll file in gac?
Give an example of a directcast.
Hi, Can we implement the Abstract class on interface in c#, If yes then provide the code implementation
Does unity use c++ or c#?
What are c# i/o classes?
Is string null or empty?
What are partial classes and use of partial classes?
What are the 2 broad classifications of data types available in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)