Please improve the java code to be able to compile successfully. Below please find the 3 class codes.Provide the improved Sort, MergeSort, and SortTest java codes that successfully compile and run.Here is the Sort.java code:import java.io.BufferedReader;import java.io.File;import java.io.FileReader;import java.io.IOException;import java.util.ArrayList;public class Sort extends Thread{ /** You are to implement this method. The method should invoke one or * more threads to read and sort the data from the collection of Files. * The method should return a sorted list of all of the String data * contained in the files * @param file * @ return * @tgrows IOException */ public static String[] threadedSort(File[] files) throws IOException{ //commenting out to ue the multithread /*throw new java.lang.IllegalStateException(“Method not implemented”); */ String[] sortedData = new String[0]; Thread t = new Thread(new Runnable(){ public void run(){ try{ for(File file : files){ String[] data = getData(file); data = MergeSort.mergeSort(data); sortedData = MergeSort.merge(sortedData, data); } } catch(IllegalStateException e){ System.out.println(“Message: ” + e.getMessage()); } } }); t.start(); return sortedData; } /** * Given an array of files, this method will return a sorted * list of the String data contained in each of the files. * @param files the files to be read * @return the sorted data * @throws IOException thrown if any errors occur reading the file */ public static String[] sort(File[] files) throws IOException{ String[] sortedData = new String[0]; for(File file : files){ String[] data = getData(file); data = MergeSort.mergeSort(data); sortedData = MergeSort.merge(sortedData, data); } return sortedData; } /** * This method will read in the string data from the specified * file and return the data as an array of the String objects * @param file the file containing the String data * @return String array containing the String data * @throws IOException thrown if any errors occur reading the file */ private static String[] getData(File file) throws IOException{ ArrayList
Java code
Get your custom paper done at low prices
275 words/page
Double spacing
Free formatting (APA, MLA, Chicago, Harvard and others)
12 point Arial/Times New Roman font
Free title page
Free bibliography & reference
TESTIMONIALS
What Students Are Saying
Outstanding, thank you very much.
Awesome. Will definitely use the service again.