What happens when Dictionary.Add is called with a key that is already present?
Correct answer B. An ArgumentException is thrown
Explanation
Dictionary keys must be unique. Add throws ArgumentException if the key already exists, which protects against accidental overwrites. If you intend to replace the value, use the indexer, dict[key] = value, which adds or updates. TryAdd returns false instead of throwing when the key exists.
Answer checked How we write and check questions
Discussion