Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 8
    It won't be called because you did not call each inherited class. The problem is rather that if First and Second are both inheriting another class and calling it directly then this common class (starting point of the diamond) is called twice. super is avoiding this. Commented Jul 29, 2014 at 12:04
  • @Trilarion Yea, I was confident it wouldn't. However, I didn't definitively know and I didn't want to state as if I did even though it was very unlikely. That's a good point about the object being called twice. I didn't think about that. I just wanted to make the point that you call parent classes directly. Commented Jul 30, 2014 at 18:58
  • Unfortunately, this breaks if init tries to access any private methods :( Commented May 10, 2018 at 21:29