8.8 Un pays francophone est  (1)

Questions

8.8 Un pаys frаncоphоne est  (1)

Thrоugh fill in the blаnk, write the cоde fоr а public stаtic method named findStringInFile. The method receives a File and a String and returns a boolean if the String is present in the file (in any of its lines), false if the String isn’t found. If the file doesn’t exist, the method should propagate a FileNotFoundException. • You must follow the structure by filling in the blanks; you cannot add or remove statements. • Make sure to close every object that should be closed before returning. • Don’t write import statements or a class header. • As part of error handling, use the Scanner’s NoSuchElementException • Use String’s instance method contains (which can accept a String, and returns a boolean) public static _____________ findStringInFile(____________ file, String s)______________________________________________ {// Method header includes this line     Scanner sc = _________________________________;      try {          sc = _____________________________________;           while (true) {               String line = sc.___________________________________;                if (_______________________________________________) {                    return ________________________________________;                }          }     catch (____________________________________________ e) {          return _________________________________________;      } finally {          if (______________________________________________) {               sc.___________________________________________;           }     }} Be sure to number your answers!