Which of the following statements is false?
a) Prior to C# 6, you could use a fully braced collection initializer to initialize a
Dictionary’s key–value pairs. For example, if you had a Dictionary
```
var toolInventory = new Dictionary
{"Hammer", 13},
{"Saw", 17},
{"Screwdriver", 7}
};
```
b) The code in a) is shorthand for creating the Dictionary then using its Add method to
add each key–value pair.
c) C# 6’s index initializers enable you to clearly indicate the key and the value in each key–value pair as follows:
```
var toolInventory = new Dictionary
["Hammer"] = 13,
["Saw"] = 17,
["Screwdriver"] = 7
};
```
d) Prior to C# 6, any collection that defined an Add extension method could be initialized with a collection initializer. As of C# 6, the compiler also supports collection initializers for any collection that has an Add instance method.
d) Prior to C# 6, any collection that defined an Add extension method could be initialized with a collection initializer. As of C# 6, the compiler also supports collection initializers for any collection that has an Add instance method.
You might also like to view...
If you are a marketing and sales manager, you would most likely use the ________ KPI
A) productivity by channel B) on-time delivery C) service satisfaction levels D) gross yield
A __________ is a collection of similar records.
A) ?file ? B) ?database ? C) ?record D) ?field