title: Date and calendar java
body: <pre><code>class Employee
  {
  private Date doj;
  
  public Employee (Date doj)
  {
  this.doj=doj;
  }
  public Date getDoj()
  {
  return doj;
  }
  }
  
  
  class TestEmployeeSort
  {
  public static List&lt;Employee&gt; getEmployees()
  {
    List&lt;Employee&gt; col=new ArrayList&lt;Employee&gt;();
    col.add(new Employee(new Date(1986,21,22));
  }
  }
  </code></pre>
  
  <p>In the above code i have used Date to set a date. I want to know how to use calendar function to do this. I know that i can use getInstance() and set the date. But I don't know how to implement it. Please help me to know how to set Date using Calendar function</p>