Indexer (programming): Difference between revisions

Content deleted Content added
m Example: parameter misuse;
m cite repair;
Line 1:
{{Confusing|reason=is this a C# or a general OO concept? Surely the interesting thing is the use of the keyword 'this', not what is emphasised here? Why is this whole article only sourced to one C# forum post (the other forum post is a dead link). Maybe an example of use of the example class would demonstrate the purpose of the construct. Wikipedia is not a manual, guidebook or textbook [[WP:NOTHOWTO]].|date=April 2015}}
In [[object-oriented programming]], an '''indexer''' allows instances of a particular class or struct to be indexed just like arrays.<ref>{{cite web|accessdateaccess-date=2011-08-01 |author=jagadish980 |date=2008-01-29 |___locationwebsite=http://forums.sureshkumar.net/forum.php |publisher=Bulletin: SURESHKUMAR.NET FORUMS |title=C# - What is an indexer in C# |url=http://forums.sureshkumar.net/vb-asp-net-interview-technical-questions/16320-c-what-indexer-c.html |archive-url-status=dead |archiveurl=https://web.archive.org/web/20090922193214/http://forums.sureshkumar.net/vb-asp-net-interview-technical-questions/16320-c-what-indexer-c.html |archivedatearchive-date=September 22, 2009 }}</ref> It is a form of [[operator overloading]].
 
== Implementation ==
Line 8:
Here is a C# example of the usage of an indexer in a class:
<ref>{{cite web
| accessdateaccess-date = 2011-08-01
| publisher website= .net Funda
| title = C# Interview Questions
| url = http://www.dotnetfunda.com/interview/exam4161-what-is-an-indexer-in-csharp-.aspx}}</ref>
Line 77:
 
== References ==
{{Reflist|2}}
 
<!--Categories-->