Given the class.
// File name: Main.java public class Main { public static void main(String[] args) { System.out.println(args[0] + " " + args[args.length-1]); } }
what would be the result of executing the following command line?.
>java Main In movie orange is not a apple
Select the one correct answer.
(d)
The length of the array passed to the main()
method is equal to the number of program arguments specified in the command line.
The element at index 0 does not contain the name of the program.
The first argument given is retrieved using args[0], and the last argument given is retrieved using args[args.length-1].