Ask Question
26 February, 23:24

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);

+4
Answers (1)
  1. 27 February, 00:33
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers