开发者

Does a class have to implement a interface directly

Quick question. Does a class have to implement a interface directly to be accepted, or can it be a child of a parent class that im开发者_高级运维plements it.

so If I pass a child object into a method that only accepts IOBJECT, but the child class parent implements IOBJECT. will child object be accepted ?


If the parent satisfies IS-A for an interface type the child does as well. The child need not implement the interface.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜