![](/img/trans.png)
[英]method setText(String) in the type Part is not applicable for the arguments
[英]The method setStdGPA(Float) in the type StudentBean is not applicable for the arguments (String)
如何通过将float转换为String来解决此错误,我的代码在这里
private StudentBean prepareStudentBean(Student student){
StudentBean bean = new StudentBean();
bean.setStdId(student.getStdId());
bean.setStdName(student.getStdName());
bean.setStdClass(student.getStdClass());
bean.setStdGPA(student.getStdGPA());
return bean;
}
StudentBean类型的setStdGPA(Float)方法不适用于参数(字符串)
尝试这个
bean.setStdGPA(Float.valueOf(student.getStdGPA());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.