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