public static void main(string[argsint size /create array of links link[linkarray new link[size]for(int = <sizej++/fill array with links /random number int (int)(java lang math random()* )link newlink new link( )/make link linkarray[jnewlink/put in array /display array contents system out print("unsorted array")for(int = <sizej++system out printlinkarray[jddata )system out println("")/create new list/initialized with array sortedlist thesortedlist new sortedlist(linkarray)for(int = <sizej++/links from list to array linkarray[jthesortedlist remove()/display array contents system out print("sorted array")for(int = <sizej++system out print(linkarray[jddata ")system out println("")/end main(/end class listinsertionsortapp this program displays the values in the array before the sorting operationand again afterward here' some sample outputunsorted array sorted array the output will be different each time because the initial values are generated randomly new constructor for sortedlist takes an array of link objects as an argument and inserts the entire contents of this array into the newly created list this helps make things easier for the client (the main(routinewe've also made change to the insert(routine in this program it now accepts link object as an argumentrather than double we do this so we can store link objects in the array and insert them directly into the list in the sortedlist java programit was more convenient to have the insert(routine create each link objectusing the double value passed as an argument