Solved

Which Code Fragment Would Correctly Identify the Number of Arguments

Question 20

Multiple Choice

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 = args.length - 1;
C) int count = 0; while (args[count] != null) count ++;
D) int count=0; while (!(args[count].equals("") ) ) count ++;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents