Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. 3 Read one line from the data file
  2.  
  3. 1. Add a declaration of a local variable to the end of your setup. The variable should be
  4. called header and should be type String.
  5. 2. Initialise header to the value returned from your scanner (in) when you call its
  6. nextLine function. The complete line of code looks like this:
  7. 1 header = in. nextLine ();
  8. 3. Add a println statement to print the value of header.
  9. 4. Run your program. In the console panel you should see the first line of the file which
  10. is the header line and not part of the data.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement