indexers-abc/2/b.cs - A client of A which uses the string indexing of A. | Lecture 5 - slide 14 : 29 Program 2 |
using System; class B { public static void Main(){ A a = new A(5); double d; a["d"] = 6; a["e"] = 7.0; a["f"] = 8.0; d = a["e"] + a["f"]; // corresponds to d = a.d + a.e // in case d and e had been public Console.WriteLine("a: {0}, d: {1}", a, d); } }