我有一个方法返回类型为ArrayList<String>
,它也读取相同类型的参数。现在我该如何type cast
或修改我的BigDecimal来读取该值?BigDecimal的类型转换
public static ArrayList<String> currencyUtilArray(ArrayList<String> amountStr) {
BigDecimal amount = new BigDecimal(ArrayList<String> amountStr);
//How do I define that the amountStr is ArrayList<String> and need to place in BigDecimal amount one after another till the end of the List
return amountStr;
}
或者我需要做的
你是不是想一个ArrayList的''转换为一个ArrayList的''? –
Gabe
2012-01-03 07:26:55
@Gabe一个方法会调用并发送值列表,现在说''1234.5678'和'4567.1234'这两个值到'currUtil'这个方法现在我需要定义我的方法'currUtil',这样它就读取值并将其放置在BigDecimal中一个接一个地处理它。如何定义我的方法? – 2012-01-03 07:35:44