import java.nio.file.*;import java.io.*;public class ReadEmployeeFile{   public static void main(String[] args)   {      Path file =        Paths.get("C:\\Java\\Chapter.13\\Employees.txt");      String s = "";      try      {         InputStream input = new           BufferedInputStream(Files.newInputStream(file));         BufferedReader reader = new           BufferedReader(new InputStreamReader(input));

         -----Code here-----
         while(s != null)         {             System.out.println(s);
             -----Code here-----
         }         reader.close();     }     catch(Exception e)     {        System.out.println("Message: " + e);     }   }
}The above code represents a program that reads an Employees text file. An InputStream is declared for the file, and a BufferedReader is created using the InputStream. On the indicated lines, write a statement that will read the first line into the String. Likewise, in the while statement, write the statement to display the String and read a new line as long as the readLine() method does not return a null value.

What will be an ideal response?


s = reader.readLine();s = reader.readLine();

Computer Science & Information Technology

You might also like to view...

Grouping data is useful in a database with a single-field primary key

Indicate whether the statement is true or false

Computer Science & Information Technology

A forest transitive trust enables you to share resources between forests operating at the Windows Server 2003 or higher forest functional level. Users in either forest can be authenticated to and access resources in the other forest if _______________

a. The users have accounts in each forest b. The trust is two-way c. The users are in the Domain Admins group d. The users have roaming profiles

Computer Science & Information Technology

When assigning an id to an HTML element, there is a corresponding JavaScript method called ____ that must be invoked for your JavaScript code to access it by id.

A. getElementByClass() B. getElementByCode() C. getElementByName() D. getElementById()

Computer Science & Information Technology

COGNITIVE ASSESSMENT You have just designed a device-tracking app for sale in the app marketplace. Which of the following are you least likely to use in your app?

A. GPS B. Wi-Fi C. UNIX D. IP addresses

Computer Science & Information Technology