Computer Applications

Which of the following is a valid method prototype in Java?

User Defined Methods

2 Likes

Answer

public double calculate(double x, double y)

Reason — The syntax of a method prototype is:

<access-specifier> <return-type> <method-name> (<parameter-list>)

Only public double calculate(double x, double y) follows this syntax.

Answered By

2 Likes


Related Questions