super Keyword

AP Computer Science A· difficulty 4/5

In a subclass constructor, <code>super(args)</code> must

  • A

    Be the first statement, calling the parent's matching constructor

    check_circle
  • B

    Be the last statement of the constructor

  • C

    Be optional and may appear anywhere in the constructor

  • D

    Always be called with no arguments

Explanation

Java requires super(...) (or this(...)) as the first statement of any constructor. If omitted, super() is implicitly inserted and must match a no-arg parent constructor.

Want 10 more like this — adaptive to your weak spots?

Related questions