Which two code fragments can be independently inserted at line n1 to enable the code to print the elements of the array in reverse order?

Given the code fragment:

Which two code fragments can be independently inserted at line n1 to enable the code to print the elements of the array in reverse order? (Choose two.)
A.

B.

C.

D.

E.

Download Printable PDF. VALID exam to help you PASS.

5 thoughts on “Which two code fragments can be independently inserted at line n1 to enable the code to print the elements of the array in reverse order?

  1. B, C and D will make “java.lang.ArrayIndexOutOfBoundsException: -1”, due to they use condition (>=0),
    rest options A,E will provide correct result:
    # javac Test19.java
    # java Test19
    5040302010

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.