Interview Tips Interview Tips, Interview Questions and Answers

27Jan/100

What do you mean by Explicit Interface Implimentation? What’s Interface Mapping?

A class that implements an interface can explicitly implement a member of that interface. When a member is explicitly implemented, it cannot be accessed through a class instance, but only through an instance of the interface
When class implement interface user mandatory needs to specify interface method body. Such implementation is called as Exlicit
implementation. All the signature of interface API must be compatible with interface API. Dervice class can also define their
own API.

   1: interface I1

   2: {

   3: void someMethod();

   4: }

   5: Interface I1

   6: {

   7: void someMethod();

   8: }

   9:  

  10: class someClass:I1 I2

  11: {

  12: void I1.someMethod()

  13: {

  14: //This is called explicit implementation as i am telling the compiler to implement someMethod of interface I1

  15: }

  16: void I2.someMethod()

  17: {

  18: //This is called explicit implementation of someMethod of I2 interface

  19: }

  20: }

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.