Question: Problem 3 Create a new void method called readTextFiles, to read the content of the fortunes . txt . You can use any stream

Problem 3
Create a new void method called "readTextFiles", to read the content of the "fortunes . txt". You can use any stream or reader class to complete this task.
NOTE: Anything declared in a block is local to the bloc So don't declare something in try block if you want to use it outside the block. (See Savitch, p.585)
Problem 4(Optional)
With your neighbor(s), write a method based on the following instruction, which writes out the Phrase "Toy boat" 100 times.
a) In your program implement a for loop that calls printWriter.print Ln( "Toyboat")100 times.
b) However, before you complete section (a), copy and paste the following code in your IDE. Call it from main (), did you get an error? If yes, why? Place your answer as comments in your code.
c) What import statement do you need?
I am working with java, usung try and catch i dont know how to convert a txt file into reader in java
Problem 3 Create a new void method called

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!