Deck 2 Flashcards

1
Q

Which core technology allows interoperability between Microsoft Visual Basic .NET code and C# code?

A

Microsoft Intermediate Language (MSIL)

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

What is an advantage of strongly typed code languages like .NET?

A

Capturing of errors during compilation.

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

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

A

Dispose

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

Which feature is automatically handled in managed code but must be explicitly handled in unmanaged code?

A

Memory Disposal

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

You want to access a native Win32 function from a .NET application. You import the function. Which two keywords should you use to define the function? (Each correct answer presents part of the solution. Choose two.)

A

Extern
—–AND—–
Public

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

A class named Student is contained inside a namespace named Contoso.Registration. Another class named Student is contained inside a namespace named Contoso.Contacts. You need to use both classes within the same code file. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.) Add the following line of code on the top of the code file:

A

Using Contoso;
Refer to the classes by using the Student class wrapped within the regions named
Registration and Contacts.
———–
Add the following lines of code on the top of the code file:
Using Contoso.Contacts;
Using Contoso.Registration;
Refer to the classes by using the Student class.

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

Which describes the effect of applying the protected accessibility modifier to a method?

A

The method is available to all classes derived from the declaring class.

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

You want to create a class named ShoppingCart that has a type argument named TItem. The TItem type argument must be a value type. Which code segment should you use to define the ShoppingCart class?

A
public class ShoppingCart
Where Titem : struct
{
 //do something
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

You create a class library named Contoso.Business. The library is used in a Windows application named Contoso.Ui. In which file should you store application configuration settings during deployment?

A

Contoso.Ui.config

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

Which is the base class of all classes in the .NET Framework?

A

System.Object

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

You want to raise a custom exception. Which keyword should you use?

A

Throw

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

What is the purpose of the app.config file?

A

To configure the version of .NET targeted by the application.

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

What is the characteristic of a delegate?

A

An object that raises an event

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

You write code that reads a file from the disk. Which exception will catch an error if the file is missing?

A

IOException

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

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

A

Web.config

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

Which two actions should you perform to consume events defined in another class? (Each correct answer presents part of the solution. Choose two.)

A

Match the signature of the delegate declared for the event.
—–AND—–
Define an event handler method.

17
Q

Which .NET object combines the identity and role of a user?

A

GenericIdentity

18
Q

Which three policy types are .NET security policy levels? (Choose three.)

A
Machine
-----AND------
Application domain policy
-----AND------
Enterprise policy
19
Q

You need to find out whether an application has access to delete files from the C:\Logs directory. Which code segment should you use?

A

var permission = new FileIOPermission(FileIOPermissionAccess.Write, “C:\Logs”);