【发布时间】:2011-03-18 19:54:50
【问题描述】:
我有一个关于 Java 接口的基本问题。
如果我有interface IA
和interface IB extends IA
现在,
class CK implements IB,
class CL implements IB,
class CM implements IB,
...等
void foo(IA iFace) {
// I know how to check if iFace is of type CK/CL/CM ...
// Is it possible to check if iFace is of type IB ?
}
希望我的问题很清楚。
感谢您的任何回复。
【问题讨论】:
标签: java inheritance interface