开发者

Does a class have to implement a interface directly

开发者 https://www.devze.com 2022-12-15 16:15 出处:网络
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.

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

精彩评论

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