Question: Below is the program I have written. Now you see the black text box below is how the teacher worded it. It looks like

Below is the program I have written. Now you see the black text box below is how the teacher worded it. It looks like I need to upgrade it by separating the string into words and output them. Then improve the program further by putting words in dynamically increasing array. import java.io.*; import java.util.Scanner; public class filereader2 { public static void main(String[] args) { } try { } File file2 = new File("myfile.txt"); Scanner reader = new Scanner(file2); while (reader.hasNextLine()) { } String st-reader.nextLine(); System.out.println(st); reader.close(); }catch (IOException Ex1) { }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
