Advertisement
Guest User

shouldnt this work

a guest
Oct 19th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1.  
  2.  
  3. public int lines(File file) throws Exception{
  4.  
  5. File f = new File(this.filePath); //instance variable String filePath = file.getPath();
  6. reader = new Scanner(f);
  7. int lineCount = 0;
  8. while (reader.hasNextLine()){
  9. lineCount++;
  10. reader.nextLine();
  11.  
  12. }
  13.  
  14. return lineCount;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement