title: Adding and removing properties from java object
body: <p>How can i achieve this in java. i have an object which has <code>properties</code>.</p>
  
  <pre><code>public class Object {
  
      private final Credentials Credentials;
      private final int PageSize;
      private final int PageStart;
      private final int DefaultFilterId;
  
      public Object(Credentials Credentials, int PageSize, int PageStart, 
  int DefaultFilterId) {
              this.Credentials = Credentials;
              this.PageSize = PageSize;
              this.PageStart = PageStart;
              this.DefaultFilterId = DefaultFilterId;
         }
  
      }
  </code></pre>
  
  <p>Now i am forming a this object like this</p>
  
  <pre><code>Object obj = new Object(args);
  </code></pre>
  
  <p>At some point i need the same Object, with new <code>properties</code> added but removing <code>some</code>.</p>
  
  <p>I do something like this in javascript. </p>
  
  <pre><code>var myCars=new Array();
  myCars[0]="Saab";
  myCars[1]="Volvo";
  myCars[2]="BMW";
  
  delete myCars[1]; or myCars.splice(1,1);
  </code></pre>