Ask Question

ublic static void mathMethod (int x) Which of the following method calls are legal? a. mathMethod (x); b. mathMethod (y); c. mathMethod (x, y); d. mathMethod (x + y); e. mathMethod (12L); f. mathMethod (12); g. mathMethod (12.2); h. mathMethod (); i. mathMethod (a); j. mathMethod (a / x);

+5
Answers (1)
  1. 31 January, 12:53
    0
    Legal calls to the method mathMethod (int x) are

    a. mathMethod (x);

    b. mathMethod (y)

    d. mathMethod (x + y);

    f. mathMethod (12)

    i. mathMethod (a);

    j. mathMethod (a / x);

    Explanation:

    If the variables x, y and a have been declared as ints then those method calls are legal since in the declaration of the method, mathMethod (int x) it is to accept an argument of type int when it is called. Note that in option j, the integer division a/x will still yield an int.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “ublic static void mathMethod (int x) Which of the following method calls are legal? a. mathMethod (x); b. mathMethod (y); c. mathMethod (x, ...” 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