Could someone help java code to read number of lines, words and characrters in paragragh .
You can count how may times the \n appears in the paragraph for lines.
For characters the total length of the paragraph String minus the characters: " ", " ", " ", ...
For words user String.split(" "); and count the length of the array minus the elements where you might an empty String with more than one length.
Yes that is a good way to do it. but when you do that you could use StringTokenizer class. it seperates a string to tokens. just change the delimeters to count sentences , lines ,words etc. I hope that could help.
every sencence finish with "."
every line finish with "\n"
every word finish with "\n" , " " , "." or ","
Well my approach would be simple, Buffered reader to read in from file, We will use java's inbuilt Hash Map class to store words, and also to count number of occurrences. Then we bubble sort the words and print top ten words, sounds simple isn't it?
Daniweb member rules include
"Do ensure that all posts contain relevant content and substance and are not simply vehicles for external links"
We also discourage people from simp/ky posting complete solutions.In future please help by pointing people in the right direction.