title: Polymorphism: calling subclass' method from superclass' variable
body: <p>In Java, when a method is going to be executed, it's declaration is first searched for at the object's real class (that defines the real type of the object). If it's not found, then the superclass is checked. If isn't found there either, the next parent class is checked, and so on. However, look at the example below:</p>
  
  <pre><code>   SuperClass s = new SubClass(list of parameter);
     s.someMethodExistOnlyInSubClass();
  </code></pre>
  
  <p>This will give me a compile time error. I thought that, as mentioned above, it would first look for <code>someMethodExistOnlyInSubClass()</code> at <code>SubClass</code>, verify that it exists there and then execute it right away. If I use a variable of the type <code>SuperClass</code> to reference an instance of <code>SubClass</code> some parameters will go to <code>SuperClass</code>'s constructor through a call to <code>super()</code> and the object will be instantiated there. In this context, to where have the remaining parameters gone?</p>