Java OCA OCP Practice Question 106

Question

Given that the for loop's syntax is correct, and given:

import static java.lang.System.*; 
class _ { //from   w  w  w . j av a 2 s .  co  m

  static public void main(String[] __A_V_) { 
    String $ = ""; 
    for(int x=0; ++x < __A_V_.length; )   // for loop 
      $ += __A_V_[x]; 
    out.println($); 
  } 
} 

And the command line:

java _ - A . 

What is the result?

  • A. -A
  • B. A.
  • C. -A.
  • D. _A.
  • E. _-A.
  • F. Compilation fails
  • G. An exception is thrown at runtime


B is correct.

Note

This question is using valid but inappropriate and weird identifiers.




PreviousNext

Related