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?  RSS feed

 
manusks sharma
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IN WHAT DIFFERENT CASES IS THE KEYWORD SUPER USED?
 
Nick George
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when you want to access methods overloaded methods from a super class, primarily.
one very common use is in constructers in which you wish to run the super constructer, and then do somthing else, i.e.

The constructer circle would make diameter=d, and we can make spokes=s.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can think of two situations: to access super class members - properties and methods, and to specify a super class constructor to use, as Nick has demonstrated.
This prints the following.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

IN WHAT DIFFERENT CASES IS THE KEYWORD SUPER USED?

Lower case.
Thanks, folks, I'll be here all week. Don't forget to tip your waitress!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!