70-536  Exam

Exam # of questions Description  Update
70-536 203 70-536... 02/15/2011
[Practice Test]   [Download Study Guide(PDF)]  [Update Exam]

70-536 - Exam Information
  • Description:Microsoft .NET Framework 2.0-Application Development Foundation
  • Passing Score:75%
  • Practice Test - Number of questions:203 questions
  • Simulation Test - Number of questions:203 questions
  • Simulation Test Duration:90 minutes
  • Has explanations:No

Question of the day

You write the following code to implement the CompanyClass.MyMethod function. public class CompanyClass { public int MyMethod(int arg) { return arg; }} You need to call the CompanyClass.MyMethod function dynamically from an unrelated class in your assembly. Which code segment should you use?

Answer(s)

  1. MyClass^ myClass = gcnew MyClass();Type^ t = MyClass::typeid;MethodInfo^ m = t->GetMethod("MyMethod");int i =(int)m->Invoke(this, gcnew array { 1 });
  2. MyClass^ myClass = gcnew MyClass();Type^ t = MyClass::typeid;MethodInfo^ m = t->GetMethod("MyMethod");int i =(int)m->Invoke(myClass, gcnew array { 1 });
  3. MyClass^ myClass = gcnew MyClass();Type^ t = MyClass::typeid;MethodInfo^ m = t->GetMethod("MyClass.MyMethod");int i =(int)m->Invoke(myClass, gcnew array { 1 });
  4. Type^ t = Type::GetType("MyClass");MethodInfo^ m = t->GetMethod("MyMethod");int i =(int)m->Invoke(this, gcnew array { 1 });
Correct Answer

MyClass^ myClass = gcnew MyClass();Type^ t = MyClass::typeid;MethodInfo^ m = t->GetMethod("MyMethod");int i =(int)m->Invoke(myClass, gcnew array { 1 });