gpt4 book ai didi

java - class.isAssignableFrom() 当不是同一个包时发送 false

转载 作者:行者123 更新时间:2023-12-02 03:57:29 26 4
gpt4 key购买 nike

我使用 isAssignableFrom() 类方法来确定其他应用程序中的类是否实现接口(interface)。因此,我在两个“应用程序”中具有相同的接口(interface),但不在同一个包中。当两个接口(interface)的封装不同时,该方法返回 false,否则返回 true。

这是正常行为吗?

最佳答案

And the method returns false when the package of both interfaces is not the same, but true otherwise.

Is that a normal behaviour ?

。包名称是类(和接口(interface))名称的一部分。当接口(interface)位于不同的包中时,它们具有不同的名称(因此不相同)。

关于java - class.isAssignableFrom() 当不是同一个包时发送 false,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35290927/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com