title: Questions about object superclasses and casting
body: <p>I'm preparing for a java exam. I came across the following question</p>
  
  <pre><code>String s = new String ("hello");
  Object o = (object) s;
  </code></pre>
  
  <p>Since <code>o</code> and <code>s</code> are both references that point to the same object, is there any difference in accessing the object through the reference <code>s</code> over the reference <code>o</code>?</p>
  
  <p>Would I be right in saying that all objects (like the one being reference by s) are subclasses of <code>Object</code> in Java and as such using the reference <code>s</code> you will be able to call the methods known by the superclass <code>Object</code> like <code>clone()</code> and the methods known by <code>String</code> like <code>length()</code>. Whereas, the superclass object reference <code>o</code> will only be able to call it's own methods and not those of the subclass?  Thanks.</p>