私は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
@Gabeこのメソッドには、 '1234.5678'や' 4567.1234'のような2つの値が呼び出され、 'currUtil'という2つの値が呼び出され、値のリストが送信されます。今は、' currUtil'というメソッドを定義して、それを処理するためにBigDecimalに1つ置きます。私のメソッドを定義する方法? –