Given the following class:
public class App { public static void main(String[] args) { System.out.println(args.length); } }
Assuming App.class is stored in an appropriate location in file appjar.jar
,
what is printed when you type the following command line?
java -cp appjar.jar -ea App 1 2 3 4
A.
The args array contains command-line arguments that are not directives to the java command.
Only the strings "1", "2", "3", and "4" are passed into args, so args.length is 4.