The method declares that it must return a boolean,

public boolean search(String searchString)

so you will receive a compile time error if the content of the function does not return a boolean...