Bubble sort implementation to sort arrays. How effecient?
<p>I sorted an array using an algorithm and when I was going trough a book. The algorithm that I wrote had a name <strong>(BUBBLE SORT)</strong> . I was wondering if the program I roughly wrote implemented the bubble sort algorithm perfectly or is there a more efficient way of doing the same?</p>

<pre><code>import java.util.Arrays;
public class Tool {
    public static void main(String[] args){

        int[] n = {4,8,12,87,32,98,12,45,94,42,938,84,63,67,86,37};
        int inter = 0;

        int arrayLength = n.length;

        int pass = arrayLength-1;
        for(int y = 0; y &lt; arrayLength - 1; y++) {
            for(int x = 0; x &lt; pass; x++) {
                if(n[x] &lt; n[x + 1]) {
                    inter = n[x];
                    n[x] = n[x + 1];
                    n[x + 1] = inter;
                    num++;
                }

            }
            pass--;
        }
        // To print the resulting array
        System.out.println(Arrays.toString(n));
    }
}
</code></pre>
