Oracle 1Z0-808 Exam question no. 79

Q.– Given the code fragment:

String[ ] strs = {"A", "B"}; 
int idx = 0;
for (Strings : strs) {
         strs[idx] .concat(" element " + idx);
         idx++;
 }
for (idx = 0; idx <strs.length; idx++) {
        System.out.println(strs[idx]);
}

What is the result?

A)  A element 0
     B element 1

B)  A 0
     B 1

C) A
     B

D) A NullPointerException is thrown at runtime.



⧪ please give your answer in a comment section.

Post a Comment

7 Comments