Midterm Flashcards
What are the 2 types of data storage?
- Mutable
- Immutable
What is mutable data storage?
Data that can be changed by the running program
What kind of data are C# strings?
Immutable
What is Parametric Polymorphism?
The use of Generic types
What is an open type regarding generics?
Declaration involves a type parameter
What is a closed type regarding generics?
Every aspect of the type is known precisely
What is Unbound Form?
Generic type where none of the type parameters have been provided with type arguments
What is the opposite of unbound form?
Bound Form or Constructed Type
How do you specify only value types?
where T : struct
How do you specify only reference types?
where T : class
How do you specify the type must have a default constructor?
where T : new()
What is a delegate?
Objectified function/method
What 3 pieces of information are in a delegate?
- Address of the method on which it makes calls
- Parameters of the method
- Return type of the method
What is comparable to a delegate in C/C++?
Function pointer
How do you declare a delegate?
delegate void MyDelegate (int x, int y);