Deck 1 Flashcards

1
Q

Which collection enforces type safety?

A

List

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

You define a method according to the following code segment.

01 void DoWork()
02 {
03    try
04    {
05       //Method body
06    }
07    catch (Exception)
08    {
09    }
10     finally
11      {
12     } 
13 }

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

A

Between lines 11 and 12

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

Which security policy level applies to all managed code on the computer?

A

Machine

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

You need to create an access rule that allows a user named UserA in MyDomain to read the contents of the Log.txt file. Which code segment should you use?

A
var fs = File.GetAccessControl("C:\\Logs\\Log.txt");
fs.AddAccessRule(new FileSystemAccessRule(@"MyDomain\UserA", FileSystemRights.ReadData, AccessControlType.Allow));
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Custom event delegates are used to:

A

Route events to one or more event handlers.

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

What data is stored on the heap?

A

Objects that contain non-value data types

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

Which application domain host manages security for web applications?

A

Browser

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

You are creating an application using .NET Framework 4.0. You write the following code segment in the application.

class CompGenerate 
where T . IComparable
{
 public T t1;
 public T t2;
 public CompGenerate(T _t1, T _t2)
 {
 t1 = _t1;
 t2 = _t2;
 }
}

Given the above class declaration which of the following constructors is correct?

A

CompGenerate gen = new CompGenerate(10.125, 2005);

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

Which of the following terms are used in cryptography? Ea ch correct answer represents a complete solution. Choose all that apply.

A
Plaintext
-----AND-----
Cipher
-----AND-----
Key 
-----AND-----
Ciphertext
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Consider the following scenario. Allen has created a Windows Presentation Foundation (WPF) database application using .NET Framework 4.0. The application helps users keep track of their e-Book collection. He identifies that some computers might have many users, such as two roommates might shar e a computer, with both individuals using the same application on the same computer to manage their e-Book collections. Allen sets up a database to handle many users without mixing up the collections. Allen has implemented a very trendy system that allows users to alter the colors, fonts, and graphics in the application, giving it a personalized look and feel.
How will Allen’s WPF database application store the users’ color choices?

A

As a setting with user scope

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

Applications are overridden by explicit version policy in the configuration files. What are those configuration files? Each correct answer represents a complete solution. Choose all that apply.

A
Computer's administrator configuration file
-----AND-----
Application configuration file
-----AND-----
Publisher policy file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which feature is available in both Microsoft Visual Basic .NET and C#?

A

Named and optional arguments in methods

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

You need to be able to install and uninstall an assembly from the Global Assembly Cache (GAC).
Which tool should you use?

A

Ngen.exe

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

When you delay sign a .NET assembly, the assembly will include:

A

Only the public key.

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

Common Intermediate Language (CIL) is converted into executable code by using:

A

Just-in-Time (JIT) compiler.

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

In which folder should you store the web.config file in a .NET web application?

A

Root

17
Q

You need to trace the execution of an application that contains C# code and Microsoft Visual Basic .NET code. Which tool should you use?

A

Microsoft Visual Studio

18
Q

Why do managed languages use references and not pointers?

A

Pointers are not type-safe.

19
Q

What is the name of the environment that runs .NET managed code?

A

Common Language Runtime (CLR)

20
Q

You need to retrieve an assembly’s Version property. Which class should you use?

A

AssemblyName