Question: Write a Java program that 1. Use a Scanner class to select a text file from your computer in a way that works with Windows.

Write a Java program that 1. Use a Scanner class to select a text file from your computer in a way that works with Windows.

2. Reads the selected text file. The text file for my test will consist of one or more rows, each row containing one or more strings of characters, separated by spaces. The strings themselves will consist of printable, non-space characters.

3. Writes the final string of each input line to a separate line on the output file, and also writes the string to the standard output (console). The output text file must be in the same directory as the input text file, where the naming convention is as follows: If the input file is abc.txt, the output file is abc_out.txt

sample input:

the sun and the moon

123 456

sample output

moon

456

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 Databases Questions!