Write a Java program that will provide a count of the number of words, number of lines, and/or number of characters according to an option specified on command line along with the absolute path or relative path to the file upon which the program will operate. The following character combinations are to represent appropriate options:-w The option -w is used to provide a count of the number of wordsin a file and the file name. -l The option -l is used to provide a count of the number of lines in the file and the file name. -c The option -c is used to provide a count of the number characters in the file and the file name.If the path to the file is provided without any of the above options, then the file name and a count of the number words, lines, and characters is written to the standard output device. Solution must include at least one additional method whose purpose is to count the number of words, number of lines, and number of characters in the file.
Write a Java
The following character combinations are to represent appropriate options:-w The option -w is used to provide a count of the number of wordsin a file and the file name.
-l The option -l is used to provide a count of the number of lines in the file and the file name.
-c The option -c is used to provide a count of the number characters in the file and the file name.If the path to the file is provided without any of the above options, then the file name and a count of the number words, lines, and characters is written to the standard output device.
Solution must include at least one additional method whose purpose is to count the number of words, number of lines, and number of characters in the file.
![](/static/compass_v2/shared-icons/check-mark.png)
Required:
Write a Java program that will provide a count of the number of words, number of lines, and/or number of characters according to an option specified on the command line along with the absolute path or relative path to the file upon which the program will operate.
all the code with screenshot has been provided in the next steps.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)