Write a program that opens a txt reads the contents of the


Question 1: Write a program that opens a .txt, reads the contents of the file line by line, and prints the content of each line. To do this, you should use look up how to use the Buffered Reader class1. Remember to use the try and catch statements to handle errors like trying to open a non-existent file.

Question 2: Modify the previous program so that it stores every line in an Array List of String objects. You have to properly declare an Array List to store the results, and use adds to store every line that your program reads in the Array List.

Question 3: Finally, modify your program so that, after reading all the content in the file, it prints how many words are inside the text file. To do this, you should use the split method of the String class. Assume the only character that separates words is whitespace " ".

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a program that opens a txt reads the contents of the
Reference No:- TGS0978859

Expected delivery within 24 Hours