indexed properties : Indexer : Class Interface C# Source Code


Custom Search

C# Source Code » Class Interface » Indexer »

 

indexed properties








    
 

using System;

public class Starter {
    public static void Main() {
        Names obj = new Names();
        Console.WriteLine(obj[1]);
    }
}

public class Names {
    object[,] _names ={{"V", 27},{"B", 35},{"D", 29}};

    public object this[int index] {
        get {
            return _names[index, 0] + " " + _names[index, 1];
        }
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Class Interface
» Indexer