title: Prevent method override at runtime in Java
body: <ul>
  <li>Class A has method x()   </li>
  <li>Class B inherits A and overrides x()</li>
  <li>Class C inherits B and overrides x()</li>
  </ul>
  
  <p>I want to make a class lib that will extend Activity class and override the method that handles the back button in Android (and more methods). I want the developer to extend my class and keep using his activity class as usual, but to enforce him to call the method's super.</p>
  
  <p>Any idea how can class B prevent its x method to be overridden <strong>at runtime</strong>?</p>
  
  <p>(I don't want to finalize x in class B.)</p>
  
  <h2>Update:</h2>
  
  <p>OK, let me try to explain what I want to achieve - I want to make a class lib that will extend Activity class and override the method that handles the back button in Android (and more methods). I want the developer to extend my class and keep using his activity class as usual, but to enforce him to call the method's super. If he won't do that, I'm in trouble.</p>