Writing Methods

AP Computer Science A· difficulty 1/5

public class C {
    public double computeAverage(int[] nums) {
        return 0.0;
    }
}
// ...

Which is the method's signature?

  • A

    computeAverage(int[])

    check_circle
  • B

    public double computeAverage(int[] nums)

  • C

    double computeAverage

  • D

    computeAverage()

Explanation

A method's signature consists of its name and parameter types only, not return type or modifiers.

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

Related questions