mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-25 00:06:47 +03:00
Fixed the custom indexer example (setter return type is void)
This commit is contained in:
parent
1717ee9d88
commit
51f7c4f6a0
@ -749,7 +749,7 @@ on a new line! ""Wow!"", the masses cried";
|
|||||||
|
|
||||||
// It's also possible to define custom Indexers on objects.
|
// It's also possible to define custom Indexers on objects.
|
||||||
// All though this is not entirely useful in this example, you
|
// All though this is not entirely useful in this example, you
|
||||||
// could do bicycle[0] which yields "chris" to get the first passenger or
|
// could do bicycle[0] which returns "chris" to get the first passenger or
|
||||||
// bicycle[1] = "lisa" to set the passenger. (of this apparent quattrocycle)
|
// bicycle[1] = "lisa" to set the passenger. (of this apparent quattrocycle)
|
||||||
private string[] passengers = { "chris", "phil", "darren", "regina" };
|
private string[] passengers = { "chris", "phil", "darren", "regina" };
|
||||||
|
|
||||||
@ -760,7 +760,7 @@ on a new line! ""Wow!"", the masses cried";
|
|||||||
}
|
}
|
||||||
|
|
||||||
set {
|
set {
|
||||||
return passengers[i] = value;
|
passengers[i] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user