title: Bubble Sorting string in an array
body: <p>I'm trying to bubble sort string data that was input into an array in descending and ascending order. </p>
  
  <p>The following is the code so far:</p>
  
  <pre><code>import java.util.*;
  public class nextLineArray
  {
      public static void main(String[] args)
      {
          Scanner input = new Scanner(System.in);
          String names[]=new String[12];
          System.out.println("Enter the 12 names: ");
          //Load Array
          for(int i = 0; i &lt; 12; i++)
          {
              names[i] = input.nextLine();
  
          }
          //Print initial list
          System.out.println("List of names via input:"+ names);
  
          //Print descending order list
          String descSort;
          descSort=bubbleSortDesc(names);
          System.out.println("Names listed sorted in descending order (via BubbleSort): "+descSort);
  
      }
      public static String bubbleSortDesc(String[] names)
      {
          String temp;
          int passNum, i, result;
          for(passNum=1; passNum &lt;= 11; passNum++)
          {
              for(i = 0; i&lt;=(11-passNum); i++)
              {
                  result=names[i].compareToIgnoreCase(names[i+1]);
                  if(result&gt;0)
                  {
                      temp=names[i];
                      names[i]=names[i+1];
                      names[i+1]=temp;
                  }
              }
          }
          return names;
  
      }
  }
  </code></pre>
  
  <p>When I try to return the sorted array to the main method it gives me the following error on the return line:</p>
  
  <pre><code>Incompatible Types
  </code></pre>
  
  <p>Our online instructor just started us out with using multiple methods and arrays at the same time and it is quite confusing...please excuse me if any of my mistakes appear to be obvious.</p>
  
  <p>Edit: I have fixed the initial problem thanks to Alexandre Santos in the comments, I am now running into a problem when executing the program after inputting the data, instead of printing the strings in the array it prints out </p>
  
  <pre><code>[Ljava.lang.String;@6d782f7c
  </code></pre>