Final answer:
The notInVocab method is a Java method that takes an array of strings called wordArray as input and returns an array containing the strings from wordArray that are not found in theVocab. It can be implemented by calling the findWord method and the countNotInVocab method appropriately.
Step-by-step explanation:
The notInVocab method is a Java method that takes an array of strings called wordArray as input and returns an array containing the strings from wordArray that are not found in theVocab. To implement this method, you would need to call the findWord method and the countNotInVocab method appropriately.
Here's an example implementation:
public String[] notInVocab(String[] wordArray) {
ArrayList notInVocabList = new ArrayList<>();
for (String word : wordArray) {
if (!findWord(word)) {
notInVocabList.add(word);
}
}
return notInVocabList.toArray(new String[0]);
}
In this implementation, the findWord method is used to check if a word is found in theVocab. If a word is not found, it is added to the notInVocabList. Finally, the notInVocabList is converted to an array and returned as the result.