 <p>Just because <code>A</code> is the base class of <code>B</code> doesn't change that <code>A</code> isn't <code>B</code>. It's <code>B</code> who's <code>A</code>.</p> <p>For example, you're a mix of your dad and you mother, but you're not your dad or your mother. If the police gets you doing something wrong with your car, would the police ask for your dad's or mom's driving license?</p> <p>You can compare the <em>police</em> with the compiler. The compiler won't accept that you set an instance of <code>A</code> in a reference typed as <code>B</code>, because they're different types.</p> <p>What compiler can accept is that an instance of <code>B</code> upcasted to <code>A</code> could be set to a reference of <code>A</code>:</p> <pre><code>B b = new B(); A a = b; b = (B)a; </code></pre>