In The Following Java Code Which Call To Sum Method Is #179
In the following Java code, which call to sum() method is appropriate?</p> <pre><code class="language-java" line="1"> class Output { public static int sum(int ...x) { int total; // ...do the sum... return total; } static void main(String args[]) { sum(10); sum(10,20); sum(10,20,30); sum(10,20,30,40); } }</code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs128 Java. It can also be found in gs gs128 Java Classes Methods - Java Method - Quiz No.1.
In the following Java code, which call to sum() method is appropriate?
class Output { public static int sum(int ...x) { int total; // ...do the sum... return total; } static void main(String args[]) { sum(10); sum(10,20); sum(10,20,30); sum(10,20,30,40); } }
only sum(10)
only sum(10,20)
only sum(10) & sum(10,20)
all of the mentioned