java className类型中的方法isIntNullCheck(包名)不适用于参数(其他包)
我有一个类来检查myServlet参数错误。我对这门课的称呼如下:
String[] paramet = request.getParameterValues(param);
BeanProcessor bean = new BeanProcessor(paramet);
if(((ErrorChecker) error).checkParameterValues(bean)) {
//do this
}
此BeanProcessor类驻留在包中。通用域名格式。使用者类别。模型pojo和till在这里工作很好
下面是ErrorChecker类方法:
import parvaz.aero.user.categories.model.pojo.BeanProcessor;
public class ErrorChecker extends JSElement{
public boolean checkParameterValues(BeanProcessor bean) {
//method body
return required;
}
当与驻留在另一个包中的BeanProcessor类同名时。通用域名格式。使用者角色。模型pojo访问此ErrorChecker类时会抛出以下错误:
The method isIntNullCheck(package.com.user.categories.model.pojo) in the type className is not applicable for the arguments (package.com.user.roles.model.pojo)
这是合乎逻辑的,因为ErrorChecker类中的导入与一个包相关,不能从其他项目调用
现在我也尝试导入第二个包,但它抛出以下错误
collides with another import statement
这个问题有解决办法吗
致意
共 (0) 个答案