Writing Methods

AP Computer Science A· difficulty 4/5

Two methods with the same name in the same class are valid only if their

  • A

    Access modifiers differ

  • B

    Parameter lists differ (overloading)

    check_circle
  • C

    Names differ

  • D

    Return types differ

Explanation

Java overloading distinguishes by parameter list, not return type alone.

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

Related questions