Suppose you used a program like Microsoft’s Notepad or UNIX’s vi to create a text file, alphabet.txt, that contains this single line of text: “abcdefg.” Provide the missing code fragments in the following Java program so that it successfully reads and displays the data in that file.
/************************************************************** TextReader.java* Dean & Dean** This reads a line of text from a text file.*************************************************************/<fragment>public class TextReader{public static void main(String[] args){File file = <fragment>;Scanner fileIn;try{fileIn = <fragment>;System.out.println(fileIn.nextLine());<fragment> // close the file}catch (FileNotFoundException e){System.out.println(e.getMessage());}} // end main} // end TextReader class
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.