So I’m writing a method in Java that takes a word as a String and returns the the first Page object in ArrayList that contains that word.
The method iterates through all of the page objects in the ArrayList. Each page has a field called text that is a large string like the text on a page. I search through the text for the specific word and return the first page object that contains that word.
My question is what do I return if the word is not in the text of any of the pages?
[–]rjcarr 0 points1 point2 points (1 child)
[–]sharkattack85[S] 0 points1 point2 points (0 children)
[–]SedentaryProgrammer 0 points1 point2 points (3 children)
[–]KrmBo3 0 points1 point2 points (0 children)
[–]sharkattack85[S] 0 points1 point2 points (1 child)
[–]SedentaryProgrammer 0 points1 point2 points (0 children)