The method is demonstrating the use of a boolean and a while loop. The method will search through a collection of notes and see if the entered string is found. The method is listed below
My main problem is with the boolean variable and the while loop. My understanding is that the while loop should only execute if the index is less than the size of the notes in the class and "found" variable is true. The first condition will be true but the second one doesnt evaluate to true so wouldn't the whole condition evaluate to false and cause the while loop to never execute. Thanks for any help you might be able to offer. I know it must be simple but I can't get my head around the problem.