Exam 70-536 : .NET Framework Application Development Foundation Part – 4

Question: 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?

  1. OrderedDictionary class
  2. HybridDictionary class
  3. ListDictionary class
  4. Hashtable class

Correct Answer: 2


Question: You are developing a custom-collection class. You need to create a method in your class. You need to ensure that the method you create in your class returns a type that is compatible with the Foreach statement. Which criterion should the method meet?

  1. The method must return a type of either IEnumerator or IEnumerable.
  2. The method must return a type of IComparable.
  3. The method must explicitly contain a collection.
  4. The method must be the only iterator in the class.

Correct Answer: 1


Question: You write the following code.
public delegate void FaxDocs(object sender, FaxArgs args);
You need to create an event that will invoke FaxDocs. Which code segment should you use?

  1. public static event FaxDocs Fax;
  2. public static event Fax FaxDocs;
  3. public class FaxArgs : EventArgs {
    private string coverPageInfo;
    public FaxArgs(string coverInfo) {
    this.coverPageInfo = coverPageInfo;
    }
    public string CoverPageInformation {
    get {return this.coverPageInfo;}
    }}
  4. public class FaxArgs : EventArgs {
    private string coverPageInfo;
    public string CoverPageInformation {
    get {return this.coverPageInfo;}
    }}

Correct Answer: 1


Question: You are writing a custom dictionary. The custom-dictionary class is named MyDictionary. You need to ensure that the dictionary is type safe. Which code segment should you use?

  1. class MyDictionary : Dictionary<string, string>
  2. class MyDictionary : HashTable
  3. class MyDictionary : IDictionary
  4. class MyDictionary { ... }
    Dictionary<string, string> t = new Dictionary<string, string>();
    MyDictionary dictionary = (MyDictionary)t;

Correct Answer: 1


Question: 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. Which code segment should you use?

  1. public class PrintingArgs
    {
    private int copies;
    public PrintingArgs(int numberOfCopies)
    {
    this.copies = numberOfCopies;
    }
    public int Copies
    {
    get
    {
    return this.copies;
    }
    }
    }
  2. public class PrintingArgs : EventArgs {
    private int copies;
    public PrintingArgs(int numberOfCopies) {
    this.copies = numberOfCopies;
    }
    public int Copies {
    get { return this.copies; }
    }
    }
  3. public class PrintingArgs {
    private EventArgs eventArgs;
    public PrintingArgs(EventArgs ea) {
    this.eventArgs = ea;
    }
    public EventArgs Args {
    get { return eventArgs; }
    }
    }
  4. public class PrintingArgs : EventArgs {
    private int copies;
    }

Correct Answer: 2

Tagged . Bookmark the permalink.

Leave a Reply