Quiz 1 - Sheet 1 Flashcards
A generic class is built around whatever type or types you supply during instantiation.
T
Generic classes, conversely, make coding a lot simpler.
T
Define a generic class.
Is built around whatever type, or types, are supplied during instantiation, enabling you to strongly type an object with hardly any effort at all.
You can test nullable types to determine whether they are null, just like you test reference types.
T
What can have any value that an “int” variable can, plus the value “null”?
nullableInt
With nullable type equivalents, there is no difference: The values contained in nullable types are implicitly converted to the required type and the appropriate operators are used.
T
What is one way to declare a nullable type variable?
Int?nullableInt;
What is the shorthand form for System.Nullable?
int?
What is the symbol used to declare a variable is of nullable type?
?
It is a binary operator that enables you to supply an alternative value to use for expressions that might evaluate to “null”. It known as the null coalescing operator.
T
The ?? operator is a ternary operator that enables you to supply an alternative value to use for an expression.
F?
If OP1 = null and OP2 = false, what is the answer of OP1&OP2 and OP1 | OP2?
False and null
What is the null coalescing operator?
A binary operator that enables you to supply an alternative value to use for expressions that might evaluate to null.
What is the symbol for the null coalescing operator?
??
List is a collection of T objects.
T
List is a generic list.
T
What generic collection type holds a collection of type T objects?
List
Why is System.Collections.Generic not included in the default namespace in Visual Studio?
It is?
You can’t set a starting list of items for generic lists.
F
How many classes do you have to implement in order to use the List functionality?
0
What does the member “int count” do?
Property providing the number of items in the collection.
Sorting a generic list is much the same as sorting any other list.
T
Predicate is a delegate type for a method used for searching, with the following return type and parameters: bool method(T targetObject).
T
How do you sort a List?
Comparison
What is Comparison?
A delegate type for a method used for sorting.
The Dictionary type enables you to define a collection of key-value pairs
T