Question: In MyWordSearch.java modify the wordsearch method so that it returns a proper index only if a full word is found to match. That is,


In MyWordSearch.java modify the wordsearch method so that it returns a proper index only if a full word is found to match. That is, a search for "eve" in "never odd or even" should return -1, whereas searches for "never", "odd", "or", or "even" should return the correct position. Then, in the main method, print out the return values only for four calls to wordSearch using "Never", "even", "odd", and "ever" as the word to search for in the string "Never odd or even".
Step by Step Solution
3.38 Rating (145 Votes )
There are 3 Steps involved in it
public class WordSearch public static void mainString args ch... View full answer
Get step-by-step solutions from verified subject matter experts
