title: How to declare anonymous arraylist in java?
body: <p>I want to declare anonymous arraylist in java so that on the nature of constructor list can be initialize with any type of object. For example:</p>
  
  <pre><code>    ArrayList&lt;Anonymous&gt; list;
  
      public AdapterChatWindow(Activity act, ArrayList&lt;CommentData&gt; list, String extras) {        
          this.act = act;     
          this.list = list;
      }
  
      public AdapterChatWindow(Activity act, ArrayList&lt;ChatHistory&gt; list) {       
          this.act = act; 
          this.list = list;
      }
  </code></pre>
  
  <p>Is this possible? Any alternate Solution? Is this possible with list type data structure?</p>