title: Java Constructor Chaining
body: <p>Hi I am just learning about constructor chaining in Java and had some questions...</p>
  
  <ol>
  <li><p>First of all could someone please explain when I would ever need to use this? Off the top of my head I seriously cannot think of a situation.</p></li>
  <li><p>In this example, within the constructor with no arguments I call another constructor. How do I access this new "James Bond" object for future use?</p>
  
  <pre><code>import java.util.*;
  
  class Employee
  {   
      private String name;
      private double salary;
  
      public Employee()
      {
          this("James Bond", 34000);
      }
  
      public Employee(String n, double s)
      {
          name = n;
          salary = s;
      }
  
      public String getName()
      {
          return name;
      }
  
      public double getSalary()
      {
          return salary;
      }
  
      public static void main(String[] args)
      {
          Employee a = new Employee();
      }
  }
  </code></pre></li>
  </ol>