title: Inheritance in Java instantiating classes polymorphism
body: <p>What is the advantage of writing:</p>
  
  <pre><code>Bicycle bike = new RoadBike(...);
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>RoadBike bike = new RoadBike(...);
  </code></pre>
  
  <p>Assuming <code>RoadBike extends Bicycle</code> of course.</p>
  
  <p>I ask because even if I write</p>
  
  <pre><code>RoadBike bike = new RoadBike(...);
  </code></pre>
  
  <p>I can still use all the methods in <code>Bicycle</code> because of the extension, so what is the point of writing it the other way?</p>
  
  <p>Thanks!</p>