????1??C#??????????
????C#?????????ú????C#??????????????????????????????????????????????????????з????????????????????иy???????????????????з??????????????????????????????????????y????????????????????????????????????????????????????????????????????C#????????????????????????????????????λ???????????????????????????????
?????????????????
????public interface IBark
????{
????void Bark();
????}
???????????????????IBark???????????????е?Bark()????
????public class Dog:IBark
????{
????public Dog()
????{}
????public void Bark()
????{
????Consol.write("????");
????}
????}
???????????Dog????????????????Bark()????
????Dog ????=new Dog();
????????.Bark();
??????????????????????Bark()????????????Dog()???????????????????????????????????y????.???????в????Bark()???????.????????????Dog()??.?????y?????????????
???????????????????:???????巽???????????????????????????Э??????????.????????????????.???м????IBark???????б??????Bark()????.????????(?????????)??????????????????????????????IBark??????????????????????Bark()???????????ù?Bark()?????????????????.???磬????????д???????.
????public class Cat:IBark
????{
????public Cat()
????{}
????public void Bark()
????{
????Consol.write("????");
????}
????}
????????????Cat?????Dog?????????????????IBark????????ù?????????????????????????Bark()??????????????????п???й???Bark()????????????.
??????????????????????.??????????????????????д????????Щ??????????????????????????????????????????????б?д.????A????????Dog??B??????дCat??.????????????????????????????????????????????????”??”?????.??????????????????.????????????IBark??????????????????.?????????????.??????????y?????????????.??????????????????????????????????????????Duck?????????????????????????????????.????????????????????Щ???????????Щ.