title: Calling methods from a super class when a subclass is instantiated
body: <p>How would you create a <code>Class</code> that whichever class extends the <code>Class</code>, methods are automatically invoked/called. Just edit my question if it sounds misleading. I'll just showcase some samples</p>
  
  <p>Example 1:</p>
  
  <p>In unity when you extend <a href="http://docs.unity3d.com/ScriptReference/MonoBehaviour.html" rel="nofollow">monobehavior</a> your methods are automatically called. I don't know if I'm right. </p>
  
  <pre><code>public class MyController : MonoBehaviour { 
  
     void Start()
      {     
        //Being Called Once
      }
  
      void FixedUpdate()
      {   
      //Being Called every update
  }
  </code></pre>
  
  <p>on libgdx</p>
  
  <pre><code>Game implements ApplicationListener {
  
  
      @Override
      public void render () {
          //Called multiple times
      }
  
  }
  </code></pre>
  
  <p>As What I have Understand and Tried Implementing it my self</p>
  
  <pre><code>public abstract Test{
  
          protected Test(){
              onStart();
          }
  
  
          public abstract void onStart();
  }
  
  
  public class Test2 extends Test{
  
      public Test2(){
  
      }
  
      @Override
      public void onStart(){
          //Handle things here
      }
  
  }
  </code></pre>
  
  <p>I'm sorry, but I still really don't know how it works or what you call this technique.</p>
  
  <p>Especially in unity, when creating multiple controllers that extends <code>Monobehavior</code>, all that controllers method that been implemented are called. Who's calling this classes and methods? Some reference or books on this would be a great help. </p>
  
  <p><strong>Note</strong>: Please edit my title for the right term to use on this. thanks</p>