문자열 배열 요소에 특정 문자가 포함되어 있는지 어떻게 알 수 있습니까? 교수형 집행 인이 필요해. 사용 된 단어의 배열은 단어입니다. continueGame()은 내가 이것을 넣을 곳입니다. 나는 내 임의의 단어를 얻을 수 있다고 생각하고 편지가 그 임의의 단어에 있는지 알아보십시오. 어떻게해야합니까?문자가 배열 요소에 있음
public void continueGame(){
letterSelected = JOptionPane.showInputDialog(null, "Take another guess!");
if(getWords().indexOf(getWords()) == (letterSelected)){
}
if(! getWords().contains(letterSelected)){
guesses++;
continueGame();
}else{
System.out.println(letterSelected);
}
checkBodyParts();
JOptionPane.showInputDialog(null, "");
}
난 정말 당신이 우리에게 준 조각을 이해하지 못하는
/**Get the random word from the array*/
public String getWords(){
String randomWord = words[randy.nextInt(words.length)];
return randomWord;
}
/**Get the indexes of the letter of the random word indices don't start with 1*/
public String getSelected(){
return letterSelected;
}
/**Finds index of the letter of randomWord*/
public int getIndex(){
int index = getWords().indexOf(getSelected());
return index;
}
내가 "나는 바보 같아."라고 읽었을 때 웃었다. – user1972601
@ user1972601 잘하고 실제로 도움이 되었습니까? StackOverflow에 대한 새로운 사용자로서 [FAQ] (http://stackoverflow.com/faq#howtoask)를 읽어 보시기 바랍니다. 감사 – Fallup