Constructors

AP Computer Science A· difficulty 3/5

A constructor:

  • A

    Has the same name as the class and no return type

    check_circle
  • B

    Returns the new object explicitly

  • C

    Returns void

  • D

    Is named init()

Explanation

Constructors share the class name; they have no declared return type (not even void).

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

Related questions