Kotlin Call Super Constructor

/*The super keyword refers to superclass (parent) objects. It is used to call
superclass methods, and to access the superclass constructor.*/

// take for example an activity in an andriod application.

class MainActivity : AppCompatActivity() {
  
 override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
    }
 //super is used inside the method onCreate of the class MainActivity, so it
// refers to the MainActivity

//Here while overriding the MainActivity.onCreate(),
//super.onCreate(savedInstanceState) calls 
// the predefined MainActivity.onCreate().Then setContentView(R.layout.activity_main)
//is added to what the onCreate method does.


/* we went from the onCreate method being the onCreate method 
to it being the onCreate method + setContentView(R.layout.activity_main)
*/
 
Delightful Dogfish