ArrayList new Syntax in java
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/14674729/arraylist-new-data-types">ArrayList new data types</a>  </p>
</blockquote>



<p>does this program works ? what is seller,buyer in the array list ?</p>

<p>Example:</p>

<pre><code>import java.util.ArrayList;

public class MyArrayList {

    public static void main(String[] args) {

        Seller sel = new Seller();
        Buyer buy = new Buyer();

        // declare an array list of type Seller
        ArrayList&lt;Seller&gt; list = new ArrayList&lt;Seller&gt;();
        list.add(sel); // add object of type Seller which is permisible
        list.add(buy);  // this statement will give an error
    }
}
</code></pre>

<p>and i saw a new ArrayList in Head First java like this
ArrayList AL = new ArrayList();</p>

<p>what is "Dog" here, and what is Seller there</p>

<p>i know i can place Integer,Characters,Strings,Object..etc in the place of &lt;     >
when does we place the words like that, its confusing me a lot++
plsease help me </p>

<p>Very Sorry for reposting it again, i forgot to ask my question on that post, so so Seller is a Class and sel is an Object right ?, so sel does Exactly same as  am i right ??</p>
