Deck 7 Flashcards

1
Q

Which describes the characteristic of the interoperability of the .NET Framework?

A

Handles exceptions consistently across languages.

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

You are creating an application using .NET Framework 4.0. The application uses an instance of the short type. Which of the following values can be stored in the instance of the short type? Each correct answer represents a complete solution. Choose all that apply.

A

-32,768 to 32,767 can be used as a short type.

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

You are creating an application using .NET Framework 4.0. You need to provide standard parameters for an event handler delegate. Which of the following are standard parameters for the event handler delegate? Each correct answer represents a complete solution. Choose all that apply.

A

Object
—–AND—–
EventArgs

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

Allen is creating an application using .NET Framework 4.0. What structure will he use to handle exceptions in the application?

A

Try-catch

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

Which of the following is an accurate description of generics?

A

A class using placeholders for one or more of the types it uses

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

What are the steps required to read text from a file?

A
using System.IO;
StreamReader sr = new StreamReader("TestFile.txt");
String line;
While(line = sr.ReadLine() != Null)
{
   Console.WriteLine(line);
}
sr.Close();
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which element is NOT required if you need a custom class to raise an event?

A

A method to add an event handler

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

Which class is used to write primitive types in binary to a stream and supports writing strings in a specific encoding?

A

BinaryWriter class

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

Which class is a byte of data that reads and writes from and to a disk?

A

Stream class

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

Namespaces are used a lot in C# programming in two ways. What are those two ways? Each correct answer represents a part of the solution. Choose two.

A

Declaring your own namespaces
—–AND—–
The .NET Framework uses namespaces to organize its many classes

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

You are creating an application using .NET Framework 4.0. You need to use a last-in collection in the application. Which of the following is a last-in, first-out collection?

A

Stack

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

How is an XmlWriter object useful when writing XML data to XML documents? Each correct answer represents a complete solution. Choose all that apply.

A

It ensures that an XML document is well-formed.
—–AND—–
It allows XML values to be passed as parameters by using CLR types instead of using strings.
—–AND—–
It ensures that XML characters are legal and contains valid element and attribute names.

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

What are the benefits of asymmetric key cryptography? Each correct answer represents a complete solution. Choose all that apply.

A

Asymmetric algorithms provide a key revocation mechanism.
—–AND—–
The same key pair is required to have effective communication with all the users of the asymmetric cryptosystem.

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

How will you define a default value, Yellow, for a simple element of the XML schema?

A

xs:element name-“ColorName” type=”xs:string” default=”Yellow”/

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

What is the major advantage of using class libraries?

A

Easy to organize and maintain your project.

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

You are creating an application using .NET Framework 4.0. You need to run numerous lines of code after the application runs, regardless of whether or not an exception occurred. Which type of block can you use to implement this?

A

Managed handler

17
Q

Which method is used to initiate a cleanup of a heap?

A

Collect

18
Q

Which of the following is a means of keeping information a secret and thus protecting the confidentiality, authenticity, and integrity of information?

A

Cryptography

19
Q

What are the steps required to use the BufferedStream class?

A
What are the steps required to use the BufferedStream class?
FileStream fs = File.Create(@"d:\temp\test.doc");
BufferedStream bs = new BufferedStream(fs);
StreamWriter sw = new StreamWriter(bs); 
sw.WriteLine("Hello Everybody")
20
Q

What are the benefits of a strong-named assembly? Each correct answer represents a complete solution. Choose all that apply.

A

It guarantees the uniqueness of a name.
—–AND—–
It ensures that subsequent versions cannot be produced.