There are two methods to implement the inherited interface: A: display the implemented interface, B: (implicit) Implement Interface
It's too difficult to write the article. I am a bit knowledgeable. Please add more. Thank you.
Interface ianimal {
String add (string name );
String Delete (string name );}
Class dog: ianimal
{
# Region ianimal Member
// Implicit implementation Interface
Public String add (string name)
{
Throw new exception ("the method or operation is not implemented .");
}
Public String Delete (string name)
{
Throw new exception ("the method or operation is not implemented .");
}
# Endregion
# Region ianimal Member
// Display implementation Interface
String ianimal. Add (string name)
{
Throw new exception ("the method or operation is not implemented .");
}
String ianimal. Delete (string name)
{
Throw new exception ("the method or operation is not implemented .");
}
# Endregion
}
B: (implicit) implemented Interface
String name = "AA ";
Dog DY = new dog (); // implicit
Dy. Add (name );
A: display implementation Interface
DOG d = new dog (); // display the call method after implementing the interface
// Type conversion is required
(Ianimal) d). Add (name );
Refer:
Http://topic.csdn.net/u/20070822/13/20161194-e05b-4a63-8b3b-51718f16dee8.html
Http://www.cnblogs.com/huashanlin/archive/2006/12/13/591129.html
Http://www.cnblogs.com/ericwen/archive/2007/12/28/1018181.html