Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- br = new BufferedReader(new FileReader(f));
- String line;
- while ((line = br.readLine()) != null) {
- lines++;
- chars += System.getProperty("line.separator").length();
- chars += line.length();
- words += line.split(" ").length;
- }
- System.out.println(lines + " " + words + " " + chars);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement