c# - What is static indexer? -


this question has answer here:

an interviewer asked me question, puzzled term because understand "static" member , i'm familiar concept of "index" meant static indexer? did searching of own unable find satisfactory definition.

static indexer not possible in c#

indexer semantics require 'this' keyword defines block of code indexer, , reference current instance of class. since static indexer have no such reference, stands reason can't define indexer static. that's personal interpretation, there may bigger picture that.

however, if have special need, indexers convenience - can accomplish want old fashioned way through methods.

the fact of matter is, however, indexers can't defined static.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -