我们如何在另一个派生类中调用两个接口的不同方法?

我们如何在另一个派生类中调用两个接口的不同方法?

问题描述:

亲爱的所有人....



先生,我只是在asp.net上接受采访。其中这个问题是在一个派生类中编写用于调用不同接口方法的程序。

i不知道答案......你能帮助我吗......... ?

Dear All....

sir i just give a interview on asp.net. in which this question ask that is write the program for calling methods of different interfaces in a single derived class.
i didnt know the answer... can you help me.........?

如果接口实现是隐式的,你可以只调用方法。

如果接口实现是显式的,你需要将类转换为该接口,调用接口的方法。
If the interface implementation is implicit, you can just call the method.
If the interface implementation is explicit, you need to cast the class to that interface an call the method of the interface.