Write a static method named textCount that takes a Scanner representing a file as a parameter and that reports?
-
various statistics about the file. In particular, your method should report the number of lines in the file, the total number of characters (not counting any new-line \n characters) in the file, and the length and text of the longest line. You may assume that the input file has at least one line of input. For example, if the file contains the following text: Twas brillig and the slithy toves did gyre and gimble in the wabe. All mimsey were the borogroves, and the mome raths outgrabe. "Beware the Jabberwock, my son, the jaws that bite, the claws that catch, Beware the JubJub bird and shun the frumious bandersnatch." The program would find that there are 9 lines (blank lines count), a total of 254 characters in the file (33 on the first line, 32 on the next line, 31 on the next line, 28 on the next, 0 on the next, etc) and that the longest line is the one that begins with "the jaws that bite". The method would produce the following output: Total lines = 9 Total chars = 254 Length of longest line = 41 Longest line = the jaws that bite, the claws that catch,
-
Answer:
There seems to be such method available since it only works for the passive working code... Good luck!
Yahoo! Answers Visit the source
Other answers
There seems to be such method available since it only works for the passive working code... Good luck!
Related Q & A:
- What is the difference between a static method and class method in Python?Best solution by pythoncentral.io
- How do I add to an array from a static method?Best solution by stackoverflow.com
- How do you convert a windows movie maker file to a regular video file?Best solution by Yahoo! Answers
- How can I send a file to a friend on Hotmail?Best solution by askdavetaylor.com
- I cannot attach a file to a mail in Yahoo.Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.