And what is your question?
However, the assignment is
Quote:
the words that start with "pre".
but you use
sTokens[i].endsWith("pre")
System.out.println(printWordsWithPre(S1));
should throw a compilation error because your function
printWordsWithPre()
does not return anything (declared as
void
).