title: Why populating priority queue in java using Offer() populates it in alphabetical order while it also gives priority to capitalized words?
body: <p>I am confused. Offer() populates the list in alphabetical order and that too it gives priority to capital words. How to populate the list in the order I type it?</p>
  
  <pre><code>import java.util.*;
  public class Bucky {
  
   public static void main(String[] args) {
    PriorityQueue&lt;String&gt; q= new PriorityQueue&lt;String&gt;();
    q.offer("first");
    q.offer("aecond");
    q.offer("zhird");
  
    System.out.printf("%s ",q);
    System.out.println();
    System.out.printf("%s ", q.peek());
    System.out.println();
  
  
   }
  
  }
  </code></pre>
  
  <p>o/p=
  [aecond, first, zhird] 
  aecond </p>
  
  <hr>
  
  <pre><code>import java.util.*;
  public class Bucky {
  
   public static void main(String[] args) {
    PriorityQueue&lt;String&gt; q= new PriorityQueue&lt;String&gt;();
    q.offer("first");
    q.offer("aecond");
    q.offer("Zhird");
  
    System.out.printf("%s ",q);
    System.out.println();
    System.out.printf("%s ", q.peek());
    System.out.println();
  
  
   }
  
  }
  </code></pre>
  
  <p>o/p= 
  [Zhird, first, aecond] 
  Zhird</p>