public static void main(String args[]) {
        //VARIABLES
        int nums[] = {99, -10, 100123, 18, -978, 5623, 463, -9, 287, 49};
        int a, b, t;
        int size;
        size = 10;
        //DISPLAY ORIGINAL ARRAY
        System.out.print("Original array is:");
        for (int i = 0; i < size; i++)
            System.out.print(" " + nums[i]);
        System.out.println();
        //THIS IS A BUBBLE SORT
        for(a=1; a < size; a++)
            for(b = size - 1; b >= a; b--){
                if(nums[b -1] > nums[b]){
                    //EXCHANGE ELEMENTS
                    t = nums[b - 1];
                    nums[b - 1] = nums[b];
                    nums[b] = t;
                }
            }
            //DISPLAY SORTED ARRAY
        System.out.print("Sorted array is:");
         for(int i = 0; i < size; i++)
             System.out.print(" " + nums[i]);
         System.out.println();
        
    }