title: Basic java parameterised constructors benefit
body: <p>Can anyone help me by describing the benefit of using parameterised constructor
  i know constructors is used to initialize objects and parameterised constructor is used to initialize objects by passing particular value.</p>
  
  <p>program 1
      //public class Pc {</p>
  
  <pre><code>//    int id;
  //    String name;
  
   //   public void display(int x, String n) {
   //       id = x;
   //       name = n;
  //        System.out.println("id:" + id + "and name is:" + name);
  //    }
  
   //   public static void main(String[] args) {
     //     Pc obj1 = new Pc();
     //     obj1.display(12, "arun");
     //     obj1.display(23, "cfggg");
     // }
  </code></pre>
  
  <p>// }</p>
  
  <pre><code>program 2
  
  public class Pc {
  
    //  int id;
    //  String name;
  
    //  public void Display() {
    //      System.out.println("id is:" + id + " and name is:" + name);
    //  }
  
     // public Pc(int id, String name) {
      //    this.id = id;
      //    this.name = name;
     // }
  
     // public static void main(String[] args) {
     //   Pc obj1 = new Pc(12, "arun");
     //     obj1.Display();
     //Pc obj2 = new Pc(23,"aaa");
     //     obj2.Display();
     // }
  </code></pre>
  
  <p>// }</p>
  
  <p>is there is any logic in creating different object and initializing it using parameterised constructor than using methods</p>