Ask Question
24 November, 02:36

Which of the following demonstrates the proper way to specify a variable-length argument list?

A. public void printValues (int ... list, String ... str)

B. public void printValues (int ... list, int x, int y)

C. public void printValues (String str, int ... list, int size)

D. public void printValues (String str, int ... list)

+2
Answers (1)
  1. 24 November, 02:41
    0
    The answer to this question is option "d".

    Explanation:

    In the given question option d is correct because variable-length argument is a new feature in J2SE 5.0 which stands for java 2 standard edition and 5.0 is the version name. It is the variable-length argument lists. A coder can create functions that uses a function to receive several parameter that is not specified. An argument type followed by an ellipsis ( ...) in the parameter list of a method means that a fixed number of arguments of that particular type is obtained by the method. and other options are not correct that can be given as:

    In option a, we do not need to use the string the variable-length argument list. That's why it is wrong. The option b and c are all wrong because in the last parameter the variable-length argument list is used.

    That's why the answer to this question is the option "d".
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Which of the following demonstrates the proper way to specify a variable-length argument list? A. public void printValues (int ... list, ...” 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