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); }? a) showProduct(5.5, 10.0);b) showProduct(10.0, 10);c) showProduct(10, 10.5);d) showProduct(33.0, 55.0)

Respuesta :

Answer:

"Option C" is the correct answer to this question.

Explanation:

In the given method definition code, a static method "showProduct" is declared, that accepts two-variable "num1 and num2", as a parameter, in which the num1 variable is an integer type and num2 is double type.  In method calling option, c is correct and others were wrong, which can be described as follows:

  • Option a and Option d both options are wrong because in method calling both parameters are double type.
  • In option b, In this option first parameter is a double type and second is an integer, that's why it is wrong.