Solved

Which Code Fragment Would Correctly Identify the Number of Arguments

Question 7

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