Nongeneric collections and generic collections are the two broad categories of what in .NET?
Collection classes
ArrayList, BitArray, Hashtable, Queue, SortedList, and Stack from System.Collections are examples of what?
Nongeneric collections
What is the process of explicitly assigning a value type to a System.Object variable, which allocates a new object on the heap and copies the value type's value into that instance?
Boxing
Why are generics in C# more performant (compared to nongeneric collections)?
They do not result in boxing or unboxing penalties when storing value types
Why are generics in C# type-safe (compared to nongeneric collections)?
They can contain only the specified type
When you see something like List<T>, what is the pair of angled brackets with a token within called?
A type parameter
What syntax is this an example of?
List<int> myGenericList = new List<int> { 0, 1, 2, 3, 4, 5, 6 };
Collection initialization syntax
This example is an example blending what two syntaxes of the C# language?
List<Point> myListOfPoints = new List<Point>
{
new Point { X = 2, Y = 2 },
new Point { X = 3, Y = 3 },
new Point { X = 4, Y = 4 }
};
Object initialization syntax and collection initialization syntax
What is probably the most frequently used type from the System.Collections.Generic namespace?
List<T>
Any application you create with .NET will need to manipulate a set of what in memory, that can come from a relational database, a text file, an XML document, a web service call, user-provided input, etc.?
Data points
What namespace are nongeneric collections typically found in .NET?
System.Collections
What are the two types of broad categories of data that the .NET Core platform supports?
Value types and reference types
What mechanism does C# provide to store the data of a value type within a reference variable?
Boxing
What is it called when you assign a .NET value type to a System.Object variable?
Boxing
What can you use to avoid the issues of boxing/unboxing performance penalties and lack of type safety of the collections in previous .NET versions?
Generic collections
What generic interface defines general characteristics (e.g., size, enumeration, and thread safety) for all generic collection types?
ICollection<T>
What generic interface allows a generic collection object to represent its contents using key-value pairs?
IDictionary<TKey, TValue>
What namespace is the generic List<T> class from in .NET?
System.Collections.Generic
What is a way you can read the symbol <T> of generic items in .NET?
"of type T"
What is it called when the CoreCLR allocates a new object on the heap to copy a value type's data value into it?
Boxing
What System.Collections interface defines general characteristics for all nongeneric collection types?
ICollection
What System.Collections interface provides behavior to add, remove, and index items in a sequential list of objects?
IList
What namespace are generic collections primarily found in .NET?
System.Collections.Generic
What notation is the telltale sign of any generic item in .NET?
<T>
What are nongeneric containers considered since they are typically designed to operate on System.Object types?
Loosely typed
What class from the System.Collections.Generic namespace represents a collection that maintains items using a last-in, first out manner?
Stack<T>
What are two members defined by Stack<T> (that you might expect)?
Push() and Pop()
What is the most frequently used type in System.Collections.Generic?
List<T>
What class from the System.Collections.Generic namespace is useful to model a scenario in which items are handled on a first-come, first-served basis?
Queue<T>
What generic interface provides the base interface for the abstraction of sets in .NET?
ISet<T>
What generic interface provides behavior to add, remove, and index items in a sequential list of objects in .NET?
IList<T>
What member of Queue<T> is used to remove and return the object at the beginning of the Queue<T>?
Dequeue()
What member of Queue<T> is used to add an object to the end of the Queue<T>?
Enqueue()
What member of Queue<T> is used to return the object at the beginning of the Queue<T> without removing it?
Peek()
What type in System.Collections.ObjectModel represents a dynamic data collection that has the ability to inform external objects when its contents have changed in some way?
ObservableCollection<T>
Previous card
First card
Random order
Next card