title: Sort array from smallest to largest using java
body: <p>I'm supposed to create an array and sort the numbers from smallest to largest. Here is what I have so far:</p>
  
  <pre><code>public class bubbleSort {
  
  public static void sort (int [] arrayName){
      int temp;
      for (int i = 0; i &lt; arrayName.length-1; i++)
      {
          if(arrayName[i] &gt; arrayName[i+1])
          {
              temp=arrayName[i];
              arrayName[i]=arrayName[i+1];
              arrayName[i+1]=temp;
              i=-1;
          }
      }
  }
  
  public static void main(String[] args) {
      int [] arrayName = new int[10]; 
      for (int i = 0; i &lt; arrayName.length; i++) { 
        arrayName[i] = (int)(Math.random()*100); 
      } 
  
      System.out.println(sort(arrayName)); 
  }
  }
  </code></pre>
  
  <p>I am getting an error on the last line where I'm trying to print it out. What am I doing wrong?</p>