我需要将这两者加在一起。这是怎么做到的?
String total = new String ("$190.00")
pRequest.getRequestAmount()
public String getRequestAmount() {
return this.formatMoney(this.fRequest.getRequestAmount());
}
答案 0 :(得分:1)
如果加在一起,你的意思是加入或连接这两个字符串,那么Nicolas已经为你解释过了。但是,如果你的目的是总结它们,那么你必须将字符串转换为一种格式,例如int,即total = Integer.parseInt(“string here”);