title: Casting Object to class type
body: <p>This code is from Java SCJP6. It's from the topic of The Comparable Interface from chapter 7 on Collections.
  In line 4 we are casting 'Object o' to DVDInfo type. I don't understand this. Why are we casting it as to DVDInfo?</p>
  
  <pre><code>class DVDInfo implements Comparable&lt;DVDInfo&gt;{
      public int CompareTo(Object o){
          DVDInfo d = (DVDInfo) o ;
          return title.compareTo(d.getTitle());
      }
  }
  </code></pre>