Constructors

AP Computer Science A· difficulty 3/5

If no constructor is defined, Java provides

  • A

    An abstract constructor

  • B

    A constructor with all fields

  • C

    A default no-arg constructor

    check_circle
  • D

    No constructor (compile error)

Explanation

Default constructor: <code>public ClassName() { super(); }</code>.

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

Related questions