Preparation progress
All questions in this channel are already marked

What is the purpose of the super keyword?

What is the purpose of the super keyword?
Like many other keywords, super has several different uses depending on the context:
  1. Define a lower bound for a generic type: Consumer<? super Number>
  2. Access a member of the parent class that is shadowed by members of the subclass or local variables: int foo = super.foo
  3. Call the parent constructor within a subclass constructor: SubClass() { super("subclass param"); }
  4. In case of ambiguity, specify the parent type explicitly (as shown in the image)
No questions left to review in this channel