Computer Science, asked by sparshtaneja969, 7 months ago

Read the following overloaded method prototypes and answer the question that follow:

void calculate ( int x, double y );

void calculate ( double x, double y, double z);

(i) Write the java statement to invoke the method “calculate” using actual parameters a = 20, b=

45.52.

(ii) Write the java prototype to overload the method calculate to return a double result and accepts two

double parameters.​

Answers

Answered by Haruhi22
1

Answer:

(I) calculate(20,45.52f)

(ii) As the above two functions return nothing so next over loading method should also have void as datatype. If are trying to return double then it will give error.

Similar questions