デスクトップ、卒研、超高速参勤交代の頻出単語のフォルダ内にある頻出単語それぞれの感情値をまとめたファイルを読込むプログラム。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | if (Character.isDigit(line.charAt( 0 ))) { // substring で左端の「1:」とかを消す // System.out.println(line.substring(line.indexOf(":") + 2)); // split で数字をカンマ区切り String line2; line2 = line.substring(line.indexOf( ":" ) + 2 ); value = line2.split( ", " ); // Integer.parseint で文字を数字に変換 num1[index] = Integer.parseInt(value[ 0 ]); System.out.println( "num1[0]= " + num1[index]); num2[index] = Integer.parseInt(value[ 1 ]); System.out.println( "num2[1]= " + num2[index]); num3[index] = Integer.parseInt(value[ 2 ]); System.out.println( "num3[2]= " + num3[index]); sum[ 0 ] = num1[index] + num2[index] + num3[index]; System.out.println( "sum[0]= " + sum[ 0 ]); // 数字を配列に格納 names[index] = value[ 0 ]; index += 1 ; } |
配列について書いてあるサイトもちょいちょい参考にしました。
テストの点数を管理するプログラムで説明している。
配列の基礎を上のサイト同様点数管理のプログラムで説明しています。
このサイトでは実行結果のイメージ図がわかりやすく書いてあり自分的には理解しやすかったです。