title: How to create a Queue which accepts any Datatype?
body: <p>How to insert both String's and Integers in the same Queue ?</p>
  
  <p>Please look at the below program, I have created two objects (<code>q</code>, <code>q1</code>). Can we insert strings and integers in one <code>Queue</code>?</p>
  
  <pre><code>import java.util.*;
  public class Solution {
     public void myMethod() {
        Queue&lt;Integer&gt; q=new PriorityQueue&lt;&gt;();
        Queue&lt;String&gt; q1=new PriorityQueue&lt;&gt;();
        q.add(3);
        q1.add("Eswar");
        System.out.println(q);
        System.out.println(q1);
     }
  
     public static void main(String...args) {
        Solution s=new Solution();
        s.myMethod();
     }
  }
  </code></pre>