Ask Question
15 September, 03:06

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

+4
Answers (1)
  1. 15 September, 03:20
    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?
Find 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 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