This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

super keyword  RSS feed

 
Satyajeet Kadam
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your method overrides one of its superclass's methods, you can invoke the overridden method through the use of the keyword super.

Q1) In below example why we are able use super keyword to invoke super class version of overloaded method ?






 
Devaka Cooray
Marshal
Posts: 5554
707
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
amolpalekar kadolkar wrote:If your method overrides one of its superclass's methods, you can invoke the overridden method through the use of the keyword super.

Yes, but you can use that keyword to call any accessible method in the super class, despite it was overridden or not.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!