Question: Write a Java program called SortedString.java that sorts Strings in a file in ascending order. Your program should read an input file name and an

Write a Java program called SortedString.java that sorts Strings in a file in ascending order. Your program should read an input file name and an output file name from a user. After that, your program should read Strings in the input file and write a sorted result to the output file. In the problem, you can assume that the number of Strings in the input file is less than 1000. You can also assume that each line has only one string. The Strings in the input file will be all capitals. The following presents a sample run of the program on Windows machines. Input file name: C:\\tmp\\t1.txt Output file name: C:\\tmp\\t1_result.txt Done. For the sample run, t1.txt has the following content: I LOVE THE JAVA PROGRAMMING LANGUAGE For the sample run, this is the correct result of t1_result.txt: I JAVA LANGUAGE LOVE PROGRAMMING THE 1

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!