vault backup: 2023-11-23 09:57:47
This commit is contained in:
parent
59212a8fc8
commit
95d5b547dc
@ -54,7 +54,17 @@ public static class Program {
|
||||
namespace Lecture;
|
||||
public static class Program {
|
||||
public static void Main() {
|
||||
var dict = Dictionary<
|
||||
var dict = Dictionary<int, string>();
|
||||
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}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user