Question: Create a text file called question2.txt and populate it with random characters, numbers, and symbols in a specific pattern. Write a Java program that
Create a text file called question2.txt and populate it with random characters, numbers, and symbols in a specific pattern. Write a Java program that implements an ArrayList to store the contents of this text file. The program should display the contents of the text file in the console, and then sort the contents according to numeric order. The sorted contents should be displayed in the console again. Note: Numeric order sorting rule is based on the numeric value of elements, such as sorting a list of integers in odd-even order. The sample of the expected results is as follows: Output - AssQuestion Two (run) x DD D run: Before sorting: [5, 6, 7, 2, 5, 3, 1, 4] After sorting: [1, 2, 3, 4, 5, 5, 6, 7] BUILD SUCCESSFUL (total time: 0 seconds)
Step by Step Solution
There are 3 Steps involved in it
It appears that you are asking for assistance in writing a Java program that reads contents from a text file displays them sorts them in numeric order ... View full answer
Get step-by-step solutions from verified subject matter experts
