title: Why won't this Java array's .sort method work?
body: <p>Starting to think I'm using the wrong book for learning. I've copied this word-for-word from Sam's Learn Java, but the <code>.sort(names);</code> method is undefined for type of array.</p>
  
  <p>I have a feeling it's to do with the <code>public static void main(String[] args) {</code> call, but I don't know how to amend it.</p>
  
  <pre><code>package arrays;
  
  import java.util.*;
  
  public class Arrays {
      public static void main(String[] args) {
          String names[] = { "Lauren", "Audrina", "Heidi", "Whitney",
                  "Stephanie", "Spencer", "Lisa", "Brody", "Frankie", "Holly",
                  "Jordan", "Brian", "Jason" };
          System.out.println("The original order:");
          for (int i = 0; i &lt; names.length; i++) {
              System.out.print(i + ": " + names[i] + " ");
          }
          Arrays.sort(names);
          System.out.println("\nThe new order:");
          for (int i = 0; i &lt; names.length; i++) {
              System.out.print(i + ": " + names[i] + " ");
          }
          System.out.println();
      }
  }
  </code></pre>