diff --git a/Prog/Collections.md b/Prog/Collections.md index c85a6c6..0a8949b 100644 --- a/Prog/Collections.md +++ b/Prog/Collections.md @@ -54,7 +54,17 @@ public static class Program { namespace Lecture; public static class Program { public static void Main() { - var dict = Dictionary< + var dict = Dictionary(); + dict.Add(3, "tree"); + dict.Add(9, "nine"); + dict[9] = "nine"; + dict[4] = "four"; + dict.Add(4, "quatre"); // Raise an exception because key 4 exists + Console.WriteLine($"{dict[4]}"); // Return four + foreach (var kv in dict) { + Console.WriteLine($"dict[{kv.Key}] == {key.value}"); + } + } }