Posts

Showing posts with the label indexers

INDEXERS IN C#

                               We have see what are properties in C# ,now moving on to the indexers in C#. The work of indexers is same as properties lets revise what properties does , Properties are used to  initialize or to read that is read write operations on private data of class. As we have seen that the  data members of class are private by default in C# so they aren't allowed to be accessed outside the  class.Hence we used property for accesing the data members of class in properties we had get and  set accessor methods get to read and set to initialize , to overwrite, values of the data member of class. Now moving on to the indexers the work of indexers is the same as properties but they are used for  accessing the array type variables which are the part of class ,indexers also have the get and set  accessor in it the work of get and set accessor is same as ...