HOTSPOT

HOTSPOT
A developer designs an interface that contains the following code:


For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:


microsoft-exams

8 thoughts on “HOTSPOT

  1. Answer is Yes-Yes-No.

    Method1 throws NotImplemented exception regardless of class.

    And class2 uses explicit interface implementation, not implicit

  2. The correct answer should be:
    No, Yes, No
    Explanation:
    Class2 someInstance = new Class2();
    someInstance.Method1() // this code don’t compiled because Class2 explicit implement Method1. So we could invoke this method only after cast it instance into INewInterface.

    1. This is correct, because INewInterface is explicitly implemented and invoking that method requires casting of the instance of that class to INewInterface. Class1 is inheriting from class2 so once casted exception will be thrown. If method1 was implicitly implemented, the instances of either class could invoke the method.

  3. Yes, no, Yes, when specifying the name of the interface as shown in the code sample that is called an implicit interface implementation

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.