title: JVM - Order of execution of sub class methods and the use of @override
body: <p>This is a newbie question.
  I read that JVM's execution starts from searching for the methodname from lowest class in the hierarchy and if the method is not available in that class it traverses to the parent class looking for the method.</p>
  
  <p>If this is the case then why do we need to use "@override" for adding custom logic to the inherited class ?</p>
  
  <p>The below example illustrates my question</p>
  
  <pre><code>class superclassA
  {
  
  method()
  {
  }
  
  }
  
  class subclassB extends superclassA
  {
  
  @Override 
  //While executing if JVM starts looking for the method name from the lowest hierarchy
  //then why do we have to use "override" as the methodname will be matched from the lowest level itself?
  method() 
  {
  --custom subclass specific code...
  } 
  
  }
  </code></pre>