title: Date.format(Date) vs. Date.format(Object)
body: <p>I found <strong>java.text.DateFormat</strong> has 2 methods to format date. One is taking Date parameter, the other taking Object parameter. I checked DateFormat source code and it seems that they call different internal methods.</p>
  
  <p><strong>My question is which method (way) I should use to format Date? WAY 1 vs WAY 2</strong> </p>
  
  <p><strong>Here is my code:</strong></p>
  
  <pre><code> Object dateObject; // This is an instance of java.util.Date
  
   DateFormat df = this.createDateFormat();
  
   String formatted1 = df.format ( (Date) dateObject );  // WAY 1
  
   String formatted2 = df.format ( dateObject );  // WAY 2 -- Calling different internal method.
  </code></pre>
  
  <p>NOTE that, For WAY 1, I cast dateObject to java.util.Date</p>
  
  <p>Anyone has any ideas? Thanks.</p>