Creating One-Dimensional Indexers : Indexer : Class C# Examples


C# Examples » Class » Indexer »

 

Creating One-Dimensional Indexers





A one-dimensional indexer has this general form:




    
element-type  this[int  index]  {
                //  The  get  accessor.
                get  {
                        //  return  the  value  specified  by  index  
                }
                
                //  The  set  accessor.
                set  {
                        //  set  the  value  specified  by  index  
                }
        }
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Class
» Indexer