Ask Question
6 July, 23:20

Suppose you have the following function prototype and variable declaration: public void goop (int[ ] z) int[ ] x = new int[10]; Which is the correct way to call the goop method with x as the argument:

(A) goop (x);

(B) goop (x[ ]);

(C) goop (x[10]);

(D) goop (&x);

(E) goop (&x[ ]);

+2
Answers (1)
  1. 6 July, 23:31
    0
    A) goop (x);

    Explanation:

    A method in Java is a collection of statements that perform some specific task and return the result to the caller. A method can perform some specific task without returning anything. Methods allow us to reuse the code without retyping the code.

    In the defined method below:

    public void goop (int[ ] z)

    int[ ] x = new int[10];

    the correct way to call the goop method will be to put the argument x in the parenthesis.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Suppose you have the following function prototype and variable declaration: public void goop (int[ ] z) int[ ] x = new int[10]; Which is ...” in 📗 Engineering 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