call subclass methods by superclass reference
<p>I have code like this:</p>

<pre><code>String stringRef = new String("Java");                    // (1)

System.out.println("(2): " + stringRef.getClass());       // (2)
System.out.println("(3): " + stringRef.length());         // (3)

Object objRef = stringRef;                                // (4)

// System.out.println("(5): " + objRef.length());            // (5) Not OK.
System.out.println("(6): " + objRef.equals("Java")); 
</code></pre>

<p>Why can I not call <code>length()</code> in line (5); and for which class will <code>equals()</code> be called in line (6)? </p>
