###前提・実現したいこと
float型の数値テキストデータを配列に格納したい。
###発生している問題・エラーメッセージ
Stringとして読み取っているので、整数しか対応できない。
###該当のソースコード
is = this.getAssets().open("sample.txt"); br = new BufferedReader(new InputStreamReader(is)); String str; while ((str = br.readLine()) != null) { text.add(str); } number = new int[text.size()][3]; for (int i = 0; i < text.size(); i++) { String[] s = text.get(i).split(","); for (int j = 0; j < 3; j++) { number[i][j] = (int) Integer.parseInt(s[j]);
###試したこと
float str
で試したが、BufferedReaderにエラー発生。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。