title: Creating an Object and initialize it with passing parameters in Java
body: <p>I am trying to create a new object and initialize it with the parameters which are passed by the following command : </p>
  
  <p><code>java -jar JAR-FILE.jar store Information.dat ClientName "Address" City Country HomePhone OfficePhone CellPhone</code></p>
  
  <p>where <code>ClientName</code> is the name of the client , <code>"Address"</code> contains the client's address and etc. The client can have a <code>HomePhone</code> or a <code>OfficePhone</code> or a <code>Cellphone</code> or all of these and even more phone numbers. </p>
  
  <p>here is the class which I tried to initialize it with parameters : </p>
  
  <pre><code>private static void SaveClient(String[] args) throws Exception 
  {
      Client SaveClient = new Client(...);
      ....
      out.writeObject(SaveClient);
      out.close();
  
  }
  </code></pre>
  
  <p>here is the <code>Client</code> constructor : </p>
  
  <pre><code>public class Client{
  
  private String ClientName;
  private Address address;
  private List&lt;String&gt; PhoneNumbers;
  
  public Client() {
      this.PhoneNumbers = new ArrayList&lt;String&gt;();
  }
  
  public Client(String ClientName, Address address) {
      this();
      this.name = ClientName;
      this.address = address;
  }
  
  public void AddPhoneNumber(String number) {
      this.PhoneNumbers.add(number);
  }
  .... 
  }
  </code></pre>
  
  <p>but I don't know how to initialize it with the passing parameters. We can assume the information is valid, also I don't want to make any changes to the "Client" constructor just modifying the <code>SaveClient</code></p>