Midterm Flashcards

1
Q

What are the 2 types of data storage?

A
  1. Mutable
  2. Immutable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is mutable data storage?

A

Data that can be changed by the running program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What kind of data are C# strings?

A

Immutable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Parametric Polymorphism?

A

The use of Generic types

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an open type regarding generics?

A

Declaration involves a type parameter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a closed type regarding generics?

A

Every aspect of the type is known precisely

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Unbound Form?

A

Generic type where none of the type parameters have been provided with type arguments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the opposite of unbound form?

A

Bound Form or Constructed Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you specify only value types?

A

where T : struct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you specify only reference types?

A

where T : class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you specify the type must have a default constructor?

A

where T : new()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a delegate?

A

Objectified function/method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What 3 pieces of information are in a delegate?

A
  1. Address of the method on which it makes calls
  2. Parameters of the method
  3. Return type of the method
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is comparable to a delegate in C/C++?

A

Function pointer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you declare a delegate?

A

delegate void MyDelegate (int x, int y);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the 2 types of delegates?

A
  1. Singlecast
  2. Multicast
17
Q

What kind of delegate accepts one or more arguments without a return value?

A

Action<>

18
Q

What kind of delegate accepts one or more arguments and returns a value?

A

Func<>

19
Q

What is the class that raises an event called?

A

Publisher

20
Q

What is the class that handles an event called?

A

Subscriber

21
Q

What are the steps to make a publisher?

A
  1. Declare a delegate
  2. Declare the event
22
Q

How do you set up a subscriber?

A

The += operator
NameOfObject.NameOfEvent += new
RelatedDelegate (functionToCall);

23
Q
A