title: How to sort random number in bubble sort
body: <p>I'm trying to put run a program that would print 1000 random number and sorted them in bubble sorting but when I run this code, it'll print my 1000 random numbers but wont sort it out. Please help me understand.</p>
  
  <pre><code>import java.util.Random;
  import java.util.Arrays;
  public class JavaApplication3 {
      public static void main(String [] args){
          Random g = new Random();
  
          int [] number = new int [1000];
  
          System.out.print("Random Numbers:");
          for (int d = 0 ; d&lt;number.length ; d++){
              int RandomG = g.nextInt(1000)+1;
              System.out.print(" " +RandomG);
          }
  
          System.out.print("\nSorted Numbers:"+Arrays.toString(BubbleSortAsceMethod(number)));
      }
      public static int [] BubbleSortAsceMethod(int[] number){
          int temp;
  
          for(int i = 0 ; i &lt; number.length-1 ; i++){
              for ( int j = 1 ; j &lt; number.length-1 ; j++){
                  if ( number[j-1] &lt; number[j]){
                      temp = number[j-1];
                      number[j-1] = number[j];
                      number[j] = temp;
                  }
              }
          }
          return number;   
      }
  }
  </code></pre>