Microsoft .NET Fundamentals v6.1 (98-372)

Page:    1 / 16   
Total 230 questions

Which part of the .NET Framework verifies that code is type-safe?

  • A. Microsoft Intermediate Language (MSIL) compiler
  • B. Common Type System (CTS)
  • C. Just-in-Time (JIT) compiler
  • D. Base Class Library (BCL)


Answer : C

You need to suspend the current thread until all Finalize() methods have been processed.
Which garbage collection method should you use?

  • A. WaitforPendingFinalizers
  • B. SuppressFinalize
  • C. Collect
  • D. Dispose


Answer : D

You define a method according to the following code segment. (Line numbers are included for reference only.)


Where should you insert code that must be executed, regardless of whether or not an error is thrown?

  • A. Between lines 05 and 06
  • B. Between lines 08 and 09
  • C. Between lines 11 and 12
  • D. Between lines 12 and 13


Answer : C

Custom event delegates are used to:

  • A. Raise one or more custom events
  • B. Handle errors generated in a try block.
  • C. Route events to one or more event handlers.
  • D. Process mouse clicks or keyboard input.


Answer : C

Which two tasks does the interoperability of the .NET language allow you to perform?
(Choose two.)

  • A. Use classes written in C# from Microsoft Visual Basic .NET code.
  • B. Write a method by using identical syntax of both C# and Microsoft Visual Basic .NET.
  • C. Create methods written in both C# and Microsoft Visual Basic .NET in the same class.
  • D. Use classes written in Microsoft Visual Basic .NET from C# code.
  • E. Convert C# code to Microsoft Visual Basic .NET or convert Visual Basic .NET code to C#.


Answer : A,D

Which three characteristics define the identity of an assembly? (Each correct answer presents part of the solution. Choose three.)

  • A. Simple text name
  • B. File size
  • C. File creation date
  • D. Culture information
  • E. Version number


Answer : A,D,E

Explanation: * The Assembly Class represents an assembly, which is a reusable, versionable (D), and self-describing building block of a common language runtime application.
* Assembly Properties include_
/ FullName (A)
Gets the display name of the assembly.
* (D) The AssemblyName.CultureInfo property gets or sets the culture supported by the assembly.

The SecureString class:

  • A. Ensures that a password is strong enough.
  • B. Protects data from being revealed during garbage collection.
  • C. Ensures that memory will always be available for a string.
  • D. Remains in memory always.


Answer : B

A type-safe language prevents:

  • A. Memory leaks.
  • B. Access to arbitrary memory locations.
  • C. Division by zero exceptions.
  • D. Null reference exceptions.


Answer : B

Explanation: Type-safe code accesses only the memory locations it is authorized to access.

Which format is the correct version for a .NET application?

  • A. minor.major.revision.build
  • B. build.revision.minor.major
  • C. major.minor.build.revision
  • D. revision.build.major.minor


Answer : C

You want to encrypt the connection string stored in the web.config file.
Which tool should you use?

  • A. ASP.NET IIS Registration Tool (RegIIS.exe)
  • B. Intermediate Language Disassembler (ILDASM.exe)
  • C. Web Site Administration Tool
  • D. Dotfuscator Software Services


Answer : A

Explanation: You can use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe) to encrypt or decrypt sections of a Web configuration file.
Example:
The following command encrypts the connectionStrings element in the Web.config file for the application SampleApplication. aspnet_regiis -pe "connectionStrings" -app "/SampleApplication" -prov
"RsaProtectedConfigurationProvider"

Type-safe code accesses only the memory locations:

  • A. It is authorized to access.
  • B. Of objects on the heap.
  • C. Of objects that are static or shared.
  • D. Of objects on the stack.


Answer : A

Which file contains the required .NET settings for an ASP.NET web application?

  • A. Default.aspx
  • B. Web.config
  • C. Global.asax
  • D. Site.master


Answer : B

You create an unmanaged object and use the object. You no longer need the object.
What should you do?

  • A. Set the value of the variable to null.
  • B. Cache the variable's value in a static variable.
  • C. Dispose the object to release memory.
  • D. Cast the object to its base type.


Answer : C

Explanation: The term "unmanaged resource" is usually used to describe something not directly under the control of the garbage collector. For example, if you open a connection to a database server this will use resources on the server (for maintaining the connection) and possibly other non-.net resources on the client machine, if the provider isn't written entirely in managed code.
This is why, for something like a database connection, it's recommended you write your code thusly: using (var connection = new SqlConnection("connection_string_here"))
{
// Code to use connection here
}
As this ensures that .Dispose() is called on the connection object, ensuring that any unmanaged resources are cleaned up.

What is the characteristic of a delegate?

  • A. A type-safe function pointer
  • B. An object that raises an event
  • C. A tightly coupled event
  • D. A property function that includes optional parameters


Answer : A

Explanation: The .NET Framework defines a special type (Delegate) that provides the functionality of a function pointer.
A delegate is a class that can hold a reference to a method. Unlike other classes, a delegate class has a signature, and it can hold references only to methods that match its signature. A delegate is thus equivalent to a type-safe function pointer or a callback.

Where are the command line arguments stored for a console application?

  • A. In a value-type parameter that is passed to the Main method.
  • B. In the Console.In property.
  • C. In a string array parameter that is passed to the Main method.
  • D. In the Console.Read() method.


Answer : C

Page:    1 / 16   
Total 230 questions