Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int lines(File file) throws Exception{
- File f = new File(this.filePath); //instance variable String filePath = file.getPath();
- reader = new Scanner(f);
- int lineCount = 0;
- while (reader.hasNextLine()){
- lineCount++;
- reader.nextLine();
- }
- return lineCount;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement