如下所示,我有两个不同arg类型的函数(String,int)。我现在有了第三个函数 public void foo(String bar){}public boolean cond(){ return Math.random但是,runsBad返回以下错误: | Error:
| no suitable method found for foo(cond() ?mismatch; bad type in conditional
如果我有什么课:public final class Foo { public Date getDate(){ return date; }如果我已经将其编译为二进制代码,而其他人已经针对它构建了代码,那么我是否可以在不破坏二进制兼容性的情况下这样做呢?date; }注意,java.sql.Date是java.util.Date的一个子类。