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

call constructor of super class?  RSS feed

 
abalfazl hossein
Ranch Hand
Posts: 635
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Must subclass call constructor of super class always and initialize its variable?

What is the exception?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it must always happen, but if the no-arg constructor is available in the super class then this constructor is called by default if you do not specify a super class constructor yourself.
Feel free to try this at home.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!