Deck 7 Flashcards
Which describes the characteristic of the interoperability of the .NET Framework?
Handles exceptions consistently across languages.
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.
-32,768 to 32,767 can be used as a short type.
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.
Object
—–AND—–
EventArgs
Allen is creating an application using .NET Framework 4.0. What structure will he use to handle exceptions in the application?
Try-catch
Which of the following is an accurate description of generics?
A class using placeholders for one or more of the types it uses
What are the steps required to read text from a file?
using System.IO; StreamReader sr = new StreamReader("TestFile.txt"); String line; While(line = sr.ReadLine() != Null) { Console.WriteLine(line); } sr.Close();
Which element is NOT required if you need a custom class to raise an event?
A method to add an event handler
Which class is used to write primitive types in binary to a stream and supports writing strings in a specific encoding?
BinaryWriter class
Which class is a byte of data that reads and writes from and to a disk?
Stream class
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.
Declaring your own namespaces
—–AND—–
The .NET Framework uses namespaces to organize its many classes
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?
Stack
How is an XmlWriter object useful when writing XML data to XML documents? Each correct answer represents a complete solution. Choose all that apply.
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.
What are the benefits of asymmetric key cryptography? Each correct answer represents a complete solution. Choose all that apply.
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 will you define a default value, Yellow, for a simple element of the XML schema?
xs:element name-“ColorName” type=”xs:string” default=”Yellow”/
What is the major advantage of using class libraries?
Easy to organize and maintain your project.