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.
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.
A& E
50
40
30
20
10
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
E
A & E