My goal is to generate random number from 0 to 100 and add them into a linkedlist object and then sort the elements.
This is my code so far. I'm running into problems when I want to display the sorted elements.
The error I get: Exception in thread "main" java.util.IllegalFormatConversionException: d != java.util.Arrays$ArrayList
Can someone throw some light into this problem? Thank You
package com.LinkedLists;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.LinkedList;
import java.util.Random;
import java.util.Set;
public class InsertRandomElements {
    public static void main(String[] args) {
        // Create a random number object from 0 to 100.
        // Create an array object.
        Random r = new Random();
        int[] random = new int[100];
        // Insert random numbers into the array
        for (int i = 0; i < random.length; i++) {
            random[i] = r.nextInt(100) + 1;
        }
        // Printing out the unsorted array
        for (int i = 0; i < random.length; i++) {
            System.out.println(random[i]);
        }
        List<int[]> randomList = Arrays.asList(random);
        // Call the method in here.
        sortElements(randomList);
    }
    // Sort the elements
    private static void sortElements(Collection<int[]> values) {
        Set<int[]> set = new HashSet<int[]>(values);
        for (int[] is : set) {
            System.out.printf("Sorted Elements: %d ", values);
        }
        System.out.println();
    }
    // Calculate Sum of the elements
    // Calculate floating point average of the elements.
}

 
     
     
     
     
    