title: Subtracting two dates gives error "The operator - is undefined for the argument type(s) java.util.Date, java.util.Date"
body: <p>In below code </p>
  
  <ol>
  <li>on subtracting <strong>date</strong> from a <strong>date</strong> giving this error <code>"The operator - is undefined for the argument type(s) java.util.Date, java.util.Date"</code></li>
  <li><p>variable <strong>currentDate</strong> is a <code>String</code>; why I couldn't save it in <code>Date</code> variable like this <br><code>Date currentDate = ddmmyy.format(new Date());</code> , does <code>.format</code> function returns <code>String</code>?</p>
  
  <pre><code>public class AgeCalculator {
  
    public static SimpleDateFormat ddmmyy=new SimpleDateFormat("dd/mm/yyyy");
  
  public static void main(String[] args) throws Exception {
  String dob = "05/01/1993";
  Date mod_date =  ddmmyy.parse(dob);
  String currentDate = ddmmyy.format(new Date());
  Date mod_currentDate = ddmmyy.parse(currentDate);
  int days = mod_currentDate-mod_date;
  
   }
  
  
  }
  </code></pre></li>
  </ol>