Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about the super

 
lang lang
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sometimes I can see the arguments in super,like this"super(i+1)",I do not know what this"i+1" mean.
would you take an example for me to explain to me?
thank you!
 
David Crossett
Ranch Hand
Posts: 102
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I mentioned in your other post, the 'super()' is a call to a constructor of the super class. If your call 'super()' contains no arguments, it will just call the default constructor of the super class, or go up the chain until it finds a default constructor. If it has arguments ( like (i + 1) ), then you know that the constructor of the super class requires some sort of arguments (int I'm guessing).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic