Which of the following would be a valid method call for the

Which of the following would be a valid method call for the following method? public static void showProduct (int num1, double num2) { int product; product = num1 * (int)num2; System.out.println(\"The product is \" + product); }

showProduct(5.5, 10.0);

showProduct(10.0, 10);

showProduct(10, 10.5);

showProduct(33.0, 55.0)

Solution

showProduct(10, 10.5);

As the function definition says showProduct (int num1, double num2) , 1st argument should be int and second argument is double. Thus the only option with 1st argument int is showProduct(10, 10.5).

Which of the following would be a valid method call for the following method? public static void showProduct (int num1, double num2) { int product; product = nu

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site