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
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
Computer Science,
4 months ago
English,
4 months ago
Biology,
8 months ago
Science,
8 months ago
Math,
1 year ago