Multiple choice technology programming languages

public class Yippee2 { static public void main(String [] yahoo) { for(int x = 1; x < yahoo.length; x++) { System.out.print(yahoo[x] + " "); } } } and the command line invocation: java Yippee2 a b c What is the result?

  1. a b

  2. b c

  3. a b c

  4. Compilation fails

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Command-line arguments: args[0]=a, args[1]=b, args[2]=c. The loop starts at x=1, so it prints args[1]=b and args[2]=c with spaces. Index 0 (a) is skipped. Output is b c.