Your if-statement is insanely large and impractical, especially if you want to compare more words. Instead, use another array or an arraylist, such as:
public class TestSentence {
public static void main(String[] args) {
String sentence = "this is am are would should has have had a sentence completion";
String[] words = sentence.split(" ");
String[] wordsToCompare = {"a", "is", "this", "am", "are", "her", "that", "had", "would", "should", "has", "have", "he", "she", "it", "they"};
// outer loop that runs through the words array
// nested loop that runs through the wordsToCompare array
// compare if each element matches and do something, otherwise if they don't match, do something else
// print
}
}
import java.util.Arrays;
import java.util.ArrayList;
public class TestSentence {
public static void main(String[] args) {
String sentence = "this is am are would should has have had a sentence completion";
String[] words = sentence.split(" ");
ArrayList<String> wordsToCompareList = new ArrayList(Arrays.asList("a", "is", "this", "am", "are", "her", "that", "had", "would", "should", "has", "have", "he", "she", "it", "they"));
// use the same logic for looping as above