Question: public static String updateFileName(Scanner sc, String curFileName) { //FIXME return ; } /** * Opens and reads the contents of the dictionary file specified in

public static String updateFileName(Scanner sc, String curFileName) {

//FIXME

return "";

}

/**

* Opens and reads the contents of the dictionary file specified in fileName. The file is

* assumed to be a text file encoded in UTF-8. It is assumed that there is one translation

* mapping per line. Each line contains a key and its translation separated by a tab.

* Note: The dictionary file is assumed to be sorted by the keys in ascending order.

*

* For each line in the dictionary file, an entry is added into wordList. The entry is a String

* array of length 2, where the value of index 0 is the key and the value of index 1 is the

* translation.

*

* When opening the file, any FileNotFoundException is caught and the error message

* "Exception: File 'fileName' not found." followed by a new line is output,

* where fileName is the name of the file that the method attempted to open.

*

* @param fileName

* @param wordList Reference to ArrayList to contain the translation mappings.

* @throws IOException if an I/O error occurs when closing the file. FileNotFoundException is

* caught when opening the file.

*/

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!