Java Program: Count characters, words and lines in a text file


/ Published in: Java
Save to your folder(s)

1. Write a program that counts the number of characters including words and lines in a file. The program prompts the user for inputting the filename. Sample output as follows:

Please enter the filename: narrative.txt

File Sample.txt has

1732 characters,

204 words and 70 lines.

*** by c0deslayer ***

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.