Latest MCTS 70-536 Real Exam Download 51-60

Ensurepass

QUESTION 51

You need to select a class that is optimized for key-based item retrieval from both small and large collections. Which class should you choose?

A. OrderedDictionary class

B. HybridDictionary class

C. ListDictionary class

D. Hashtable class

Correct Answer: B


QUESTION 52

You are creating an undo buffer that stores data modifications. You need to ensure that the undo functionality undoes the most recent data modifications first. You also need to ensure that the undo buffer permits the storage of strings only. Which code segment should you use?

A. Stack<string> undoBuffer = new Stack<string>();

B. Stack undoBuffer = new Stack();

C. Queue<string> undoBuffer = new Queue<string>();

D. Queue undoBuffer = new Queue();

Correct Answer: A


QUESTION 53

You create the definition for a Vehicle class by using the following code segment.

public ref class Vehicle

{ public :

[XmlAttribute(AttributeName = "category")] String= vehicleType;

String= model; [XmlIgnore]

int year;

[XmlElement(ElementName = "mileage")] int miles;

ConditionType condition;

Vehicle() {}

enum ConditionType

{ [XmlEnum("Poor")] BelowAverage, [XmlEnum("Good")] Average, [XmlEnum("Excellent")] AboveAverage

}

};

You create an instance of the Vehicle class. You populate the public fields of the Vehicle class instance as shown in the following table:

clip_image001

You need to identify the XML block that is produced when this Vehicle class instance is serialized. Which block of XML represents the output of serializing the Vehicle instance?

A. <?xml version="1.0" encoding="utf-8"?>

<Vehicle

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/ XMLSchema" category="car">

<model>racer</model>

<mileage>15000</mileage>

<condition>Excellent</condition>

</Vehicle>

B. <?xml version="1.0" encoding="utf-8"?>

<Vehicle

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/ XMLSchema"" vehicleType="car">

<model>racer</model>

<miles>15000</miles>

<condition>AboveAverage</condition>

</Vehicle>

C. <?xml version="1.0" encoding="utf-8"?>

<Vehicle

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" category="car">

<model>racer</model>

<mileage>15000</mileage>

<conditionType>Excellent</conditionType>

</Vehicle>

D. <?xml version="1.0" encoding="utf-8"?>

<Vehicle

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/ XMLSchema">

<category>car</category>

<model>racer</model>

<mileage>15000</mileage>

<condition>Excellent</condition>

</Vehicle>

Correct Answer: A


QUESTION 54

You are changing the security settings of a file named MyData.xml. You need to preserve the existing inherited access rules. You also need to prevent the access rules from inheriting changes in the future.

Which code segment should you use?

A. FileSecurity security = new FileSecurity("mydata.xml",AccessControlSections.All); security.SetAccessRuleProtection(true,true); File.SetAccessControl ("mydata.xml", security);

B. FileSecurity security = new FileSecurity(); security.SetAccessRuleProtection(true,true); File.SetAccessControl("mydata.xml", security);

C. FileSecurity security = File.GetAccessControl("mydata.xml"); security.SetAccessRuleProtection(true, true);

D. FileSecurity security = File.GetAccessControl("mydata.xml"); security.SetAuditRuleProtection(true,true);

File.SetAccessControl("mydata.xml", security);

Correct Answer: A


QUESTION 55

You are creating a class to compare a specially-formatted string. The default collation comparisons do not

apply. You need to implement the IComparable<string> interface. Which code segment should you use?

A. public class Person : IComparable<string>

{

public int CompareTo(string other) { }

}

B. public class Person : IComparable<string>

{

public int CompareTo(object other) { }

}

C. public class Person : IComparable<string>

{

public bool CompareTo(string other) { }

}

D. public class Person : IComparable<string>

{

public bool CompareTo(object other) { }

}

Correct Answer: A


QUESTION 56

You are developing a method to call a COM component. You need to use declarative security to explicitly request the runtime to perform a full stack walk. You must ensure that all callers have the required level of trust for COM interop before the callers execute your method. Which attribute should you place on the method?

A. [SecurityPermission(SecurityAction.Demand,Flags=SecurityPermissionFlag.UnmanagedCode)]

B. [SecurityPermission(SecurityAction.LinkDemand,Flags=SecurityPermissionFlag.UnmanagedCode)]

C. [SecurityPermission(SecurityAction.Assert,Flags = SecurityPermissionFlag.UnmanagedCode)]

D. [SecurityPermission(SecurityAction.Deny,Flags = SecurityPermissionFlag.UnmanagedCode)]

Correct Answer: A


QUESTION 57

You need to write a code segment that will create a common language runtime (CLR) unit of isolation within an application. Which code segment should you use?

A. AppDomainSetup mySetup = AppDomain.CurrentDomain.SetupInformation; mySetup.

ShadowCopyFiles = "true";

B. System.Diagnostics.Process myProcess; myProcess = new System.Diagnostics.Process();

C. AppDomain domain;

domain = AppDomain.CreateDomain("CompanyDomain"):

D. System.ComponentModel.Component myComponent; myComponent = new System.ComponentModel.Component();

Correct Answer: C


QUESTION 58

You need to create a method to clear a Queue named q. Which code segment should you use?

A. foreach (object e in q)

{ Dequeue();

}

B. foreach (object e in q)

{ Enqueue(null);

}

C. q.Clear();

D. q.Dequeue();

Correct Answer: C


QUESTION 59

You are testing a method that examines a running process. This method returns an ArrayList containing the name and full path of all modules that are loaded by the process. You need to list the modules loaded by a process named C:\TestApps\Process1.exe. Which code segment should you use?

A. ArrayList ar = new ArrayList(); Process[] procs; ProcessModuleCollection modules;

procs = Process.GetProcesses(@"Process1"); if (procs.Length > 0)

{

modules = porcs[0].Modules;

foreach (ProcessModule mod in modules)

{

ar.Add(mod.ModuleName);

}

}

B. ArrayList ar = new ArrayList(); Process[] procs; ProcessModuleCollection modules;

procs = Process.GetProcesses(@"C:\TestApps\Process1.exe"); if (procs.Length > 0)

{

modules =porcs[0].Modules;

foreach (ProcessModule mod in modules)

{

ar.Add(mod.ModuleName);

}

}

C. ArrayList ar = new ArrayList(); Process[] procs; ProcessModuleCollection modules;

procs = Process.GetProcessesByName(@"Process1"); if (procs.Length > 0)

{

modules = porcs[0].Modules;

foreach (ProcessModule mod in modules)

{

ar.Add(mod.FileName);

}

}

D. ArrayList ar = new ArrayList();Process[] procs;

ProcessModuleCollection modules;procs = Process.GetProcessesByName(@"C:\TestApps\Process1. exe");

if (procs.Length > 0)

{

modules = porcs[0].Modules;

foreach (ProcessModule mod in modules)

{

ar.Add(mod.FileName);

}

}

Correct Answer: C


QUESTION 60

You need to write a multicast delegate that accepts a DateTime argument. Which code segment should you use?

A. public delegate int PowerDeviceOn(bool result,DateTime autoPowerOff);

B. public delegate bool PowerDeviceOn(object sender,EventsArgs autoPowerOff);

C. public delegate void PowerDeviceOn(DataTime autoPowerOff);

D. public delegate bool PowerDeviceOn(DataTime autoPowerOff);

Correct Answer: C

Download Latest 70-536 Real Free Tests , help you to pass exam 100%.