Ask Question
12 March, 00:35

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

+2
Answers (1)
  1. 12 March, 03:23
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers