Sorting array not sorting : <p>I must set an array to accept 7 numbers from the user, then send the array to be sorted in ascending order. the array is not being sorted and its just given the values back the exact way they were entered.</p>

<pre><code>import java.util.Scanner;
public class arraySorted {

public static void main(String[] args) {


    Scanner in = new Scanner(System.in);

    int [] enterednumbers = new int[7];


    System.out.println("Enter 7 numbers in any order");
    for( int i =0; i &lt; enterednumbers.length; i++) {
    enterednumbers[i] = in.nextInt();


    }

    for (int d = 0; d &lt; enterednumbers.length; d++) {
        System.out.print(enterednumbers[d] + " ");
    }

}
public static void sort(int enterednumbers[]) {
    int n = 7;
    int temp = 0;
    for (int i = 0; i &lt;n; i++) {
        for (int j = i + 1; j&lt;n; j++) {
            if (enterednumbers[i] &gt; enterednumbers[j]) {
                temp = enterednumbers[i];
                enterednumbers[i] = enterednumbers[j];
                enterednumbers[j] = temp;

            }
        }
    }
}
}
</code></pre>

<p>The input read as:</p>

<p>Enter 7 numbers in any order
8
4
8
9
7
5
7</p>

<p>than the output is:
8 4 8 9 7 5 7 </p>
