2017-03-16 13 views
0

에 해시 맵을 objeck 설정하려면은 내가 어떻게 이런 모델 "문장"이 자바

ArrayList <Sentence> listToken = new ArrayList<>(); 
    Sentence sentence = null; 
    for (int i = 0; i < input.size(); i++) { 
     sentence.setKalimat(input.get(i)); 
     String[] token = input.get(i).split(" "); 
     for (int j = 0; j < token.length; j++) { 
      sentence.setBobotChiSquare(token[j] , new Double(0,0)); 
     } 
    } 

하지만, 온라인에 오류가 있습니다.

sentence.setBobotChiSquare(token[j] , new Double(0,0)); 

아무도 도와 줄 수 있습니까?

답변

0

귀하의 방법에는 HashMap이 있지만 매개 변수로는 Stringdouble이 필요합니다. 먼저 HashMap에 입력해야합니다.