title: How to add an object in my collection by only using add method?
body: <p>I have to create a collection of Name,Address,Age.How do I create this as a collection object in java. </p>
  
  <p>My snippet is as follows:</p>
  
  <pre><code>public class DataCollection implements java.io.Serializable{
  
      private String Name;
      private String Address;
      private int Age;
  }
  </code></pre>
  
  <p>And I have the getter and setter methods...</p>
  
  <p>In the main method, how do I create this as a collection??</p>
  
  <pre><code>list.add(new DataCollection(??????) );
  </code></pre>
  
  <p>Can someone please help me on this?</p>