Create and Use Types Flashcards

1
Q

Which two classes could you use to retrieve

information on all folders on a local system?

A

the Directory and DirectoryInfo classes

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

Which two interfaces should be implemented to use

the foreach construct with a class?

A

the IEnumerator and IEnumerable interfaces

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

What is the syntax used to declare a method that has

a generic type parameter?

A

public void GenericMethod ( T

param )

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

Which element indicates the CLR versions supported

by an application?

A

the supportedRuntime element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
Which method of the Queue class should you invoke
to retrieve and remove the first item?
A

the Dequeue method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
Which interface should you implement for a class to
release managed or unmanaged resources?
A

the IDisposable interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
Which method of the LinkedList class should be
invoked to add an object to the beginning?
A

the AddFirst method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
Which method should be implemented when creating
a class that implements the IEnumerable interface?
A

the GetEnumerator method

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

Which method should you invoke to release the

resources held by an object?

A

the Dispose method

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

Which interface should you implement to enable

sorting in a class?

A

the IComparable interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
Which method of the Queue class should you invoke
to add an item to the end?
A

the Enqueue method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
Which class should you use to invoke a method of
dynamically loaded type at runtime?
A

the MethodInfo class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
Which method of the FileStream class should you
invoke to write an array of bytes to a file?
A

the Write method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
Which class represents a collection of performance
counter settings?
A

the CounterCreationDataCollection class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
Which property of the IEnumerator class will return
the object available in the current iteration?
A

the Current property

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
Which method of the Stack class should you invoke to
add an item to the beginning?
A

the Push method

17
Q
Which method of the LinkedList class should be
invoked to add an object to the beginning?
A

the AddFirst method

18
Q

Which statement automatically disposes of and dereferences a specified object after the code block
concludes?

A

the using statement

19
Q
Which class should you use to retrieve methods of a
dynamically loaded type at runtime?
A

the MemberInfo class

20
Q
Which class should you use to dynamically
impersonate a user at runtime?
A

the WindowsImpersonationContext class

21
Q
Which permission class controls access to managed
types at runtime?
A

the ReflectionPermission class

22
Q
Which method of the StreamReader class returns a positive value indicating another character is available
but does not reposition the cursor?
A

the Peek method

23
Q
Which method of the StreamWriter class creates text
content and adds line terminator to the end?
A

the WriteLine method

24
Q
Which class should you use to compare strings from
different languages based on a particular culture?
A

the CompareInfo class

25
Q
Which two methods should be implemented when
creating a class that implements the IEnumerator
interface?
A

the MoveNext and Reset methods

26
Q

Which method is used to compare the current object to

another object?

A

the CompareTo method

27
Q
Which method of the Stack class should you invoke to
retrieve and remove the last item?
A

the Pop method

28
Q
Which method of the FileStream class should you
invoke to read data from a file into an array of bytes?
A

the Read method

29
Q

Which permission class controls access based upon
the Global Assembly Cache (GAC) instance from
which a method call originates?

A

the GacIdentityPermission class

30
Q
Which class should you use to read lines from a
standard text file?
A

the StreamReader class

31
Q

Which property of the DriveInfo class will indicate
whether a drive is a fixed, removable, or network
drive?

A

the DriveType property