我用一个方法声明定义了一个函数接口,并在另一个项目的类中实现了该方法。SonarQube违规是因为我正在重新定义Java8中已经提供的标准函数接口。XYZProfile makeRESTServiceGetCall(String str, Integer id);
"Drop this interface in favor of "java.util.function.BiFunction<String,Integer,XYZProfile>"Drop th
假设我有一个这样的接口, void generate();和如下所示的方法 x.generate();我可以用实现MyIntf的类的对象调用run()。但是,在Java中,是否可以声明run而不显式地为接口命名。
也就是说,我可以像这样指定run()吗?void run("Some object which has a method called 'void generate()'