Exam Q Nos, Answers, Braindumps (70-536)
Exam Q Nos, Answers, Braindumps (70-536)
Q No: 1
You are writing a custom dictionary. The custom-dictionary class is named MyDictionary.
You need to ensure that the dictionary is type safe.
D. Class MyDictionary
End Class
Answer: A
Q No: 2
You write a class named Employee that includes the following code segment.
Return m_EmployeeName
End Function
Return m_JobTitleName
End Function
End Class
You need to expose this class to COM in a type library. The COM interface must also
facilitate forward-compatibility across new versions of the Employee class. You need to
choose a method for generating the COM interface.
D. Define an interface for the class and add the following attribute to the class
definition.<ClassInterface(ClassInterfaceType.None)> _Public Class
EmployeeImplements IEmployee
Answer: D
Q No: 3
You are developing a custom event handler to automatically print all open documents.
The event handler helps specify the number of copies to be printed. You need to develop a
custom event arguments class to pass as a parameter to the event handler.
this.copies = numberOfCopies;
}}
this.copies = numberOfCopies;
}}
C. public class PrintingArgs {
this.eventArgs = ea;
Answer: B
Q No: 4
You need to ascertain whether MyMethod is accessible to a derived class. What should you
do?
Answer: D
Q No: 5
You are creating a class that uses unmanaged resources. This class maintains references to
managed resources on other objects. You need to ensure that users of this class can explicitly
release resources when the class instance ceases to be needed. Which three actions should
you perform? (Each correct answer presents part of the solution. Choose three.)
A. Define the class such that it inherits from the WeakReference class.
B. Define the class such that it implements the IDisposable interface.
C. Create a class destructor that calls methods on other objects to release the managed
resources.
F. Create a Dispose method that releases unmanaged resources and calls methods on other
objects to release the managed resources.
Answer: B, D, F
Q No: 6
You need to find the line of code that caused an exception to be thrown. Which property of
the Exception class should you use to achieve this goal?
A. Data
B. Message
C. StackTrace
D. Source
Answer: C
Q No: 7
You need to write a code segment that performs the following tasks:
gcnew ManagementObjectSearcher(
svc in searcher->Get()) {
Collection1->Add(svc["DisplayName"]);}
B. ManagementObjectSearcher^ searcher =
gcnew ManagementObjectSearcher(
searcher->Get()) {
Collection1->Add(svc["DisplayName"]);}
C. ManagementObjectSearcher^ searcher =
gcnew ManagementObjectSearcher(
Collection1->Add(svc["DisplayName"]);
}}
D. ManagementObjectSearcher^ searcher =
searcher->Get()) {
if ((String^)svc["State"] == "Paused") {
Collection1->Add(svc["DisplayName"]);
}}
Answer: A
Q No: 8
You need to serialize an object of type List(Of Integer) in a binary format. The object is
named data. Which code segment should you use?
MemoryStream()formatter.Serialize(ms, data)
Integer = 1 To 20
Answer: A
Q No: 9
You are developing an application that dynamically loads assemblies from an application
directory.
You need to write a code segment that loads an assembly named Company1.dll into the
current application domain. Which code segment should you use?
Path::Combine(domain->BaseDirectory,
"Company1.dll");Assembly^ assm = Assembly::LoadFrom(myPath);
Path::Combine(domain->BaseDirectory,
Path::Combine(domain->DynamicDirectory,
Domain->GetData("Company1.dll");
Answer: A
Q No: 10
You are testing a newly developed method named PersistToDB. This method accepts a
parameter of type EventLogEntry. This method does not return a value. You need to create a
code segment that helps you to test the method. The code segment must read entries from
the application log of local computers and then pass the entries on to the PersistToDB
method. The code block must pass only events of type Error or Warning from the source
MySource to the PersistToDB method.
if (entry.Source == "MySource")
{
PersistToDB(entry);
myLog.Source = "MySource";
EventLogEntryType.Warning))
PersistToDB(entry);
if (entry.Source == "MySource")
if (entry.EntryType == EventLogEntryType.Error ||
entry.EntryType == EventLogEntryType.Warning)
{
PersistToDB(entry);
myLog.Source = "MySource";
if (entry.EntryType == EventLogEntryType.Error ||
entry.EntryType == EventLogEntryType.Warning)
PersistToDB(entry);
Answer: C
Q No: 11
You are developing a class library. Portions of your code need to access system environment
variables.
You need to force a runtime SecurityException only when callers that are higher in the call
stack do not have the necessary permissions.
A. Set->Demant();
B. Set->Assert();
C. Set->PermitOnly();
D. Set->Deny();
Answer: A