Question: JAVA Create a class called SortFile. It has a single attribute - - an ArrayList of integers.The class constructor will receive a file anme as
JAVA
Create a class called SortFile. It has a single attribute an ArrayList of integers.The class constructor will receive a file anme as its parameter. This file will contain abunch of numbers. The constructor will read the numbers and add them to the ArrayList.The class will also have a method called sort. This method will receive no input and doesnot return anything. It will sort the ArrayList in ASCENDING order. It will use theQuicksort algorithm to do so DO NOT USE THE PREDEFINED COLLECTIONSSORT METHOD! Theresultant ArrayList should not have duplicate values. You can either ignore duplicatevalues as your sort the list, or remove them after you have sorted it I do not care whichway you do it so long as the finished sorted ArrayList does not contain duplicate values.The final method of this class is printList. It also does not receive any input nor returnanything. It will print the contents of the ArrayList, in order, where each value isseparated by a comma. The final number does not have a comma at the end, but a periodinstead.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
