Ask Question

Consider the following method: public double doubleVal (double x) { return x * 2; } The following code segment calls the method doubleVal: Double val = 6.5; System. out. println (doubleVal (val)); What is printed when the code segment is executed?

+1
Answers (1)
  1. 18 January, 15:11
    0
    13.0

    Explanation:

    The method doubleVal () is created to accept a single parameter of type double.

    It multiplies what ever the value of the parameter is and returns the resulting value.

    In this question The method is called within this output statement System. out. println (doubleVal (val)); (Note that val had already been declared and assigned the value of 6.5)

    The value 6.5 is doubled and outputed to the screen
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Consider the following method: public double doubleVal (double x) { return x * 2; } The following code segment calls the method doubleVal: ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers