Question 81 · 200 in bank
Given the code fragment:
Which action enables it to print AB?
Show answer
Answer: C
Explanation
Answer is C. List lst = Arrays.asList("A","B", "C","D" ); Iterator itr = lst.iterator(); while(itr.hasNext()) { String e=itr.next(); if (e=="C") { break; } else { // continue; System.out.println(e); } } // AB
Source: Adapted from community discussion — UAK94

