Ask Question
19 January, 10:12

Which code fragment would correctly identify the number of arguments passed via the command line to a Java application, excluding the name of the class that is being invoked?

a. int count = args. length;

b. int count=0; while (! (args[count]. equals (""))) count + +;

c. int count = args. length - 1;

d. int count = 0; while (args[count]! = null) count + +;

+5
Answers (1)
  1. 19 January, 13:59
    0
    The answer is a. int count = args. length

    Explanation:

    Which code fragment would correctly identify the number of arguments passed via the command line to a Java application, excluding the name of the class that is being invoked?

    a. int count = args. length;

    b. int count=0; while (! (args[count]. equals (""))) count + +;

    c. int count = args. length - 1;

    d. int count = 0; while (args[count]! = null) count + +;

    The answer is a. int count = args. length

    args is a string array object, which contains set of all arguments. You can find the number of argument by using args. length.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which code fragment would correctly identify the number of arguments passed via the command line to a Java application, excluding the name ...” 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