Q.- Given the code fragment:
10. public static void main(String[ ] args) {
11. List lst = Arrays.asList (“A”,”B”,”C”,”D”);
12. Iterator itr = lst
.iterator( );
13. while (itr.hasNext ( )) {
14. String e = itr.next( );
15. if (e == "C") {
16. break;
17. }
18. else {
19. continue;
20. System.out.print (e);
21. }
22. }
23. }
Which action enables it to print AB?
A) Comment lines 18 to 21.
B) Comment line 19.
C) Comment line 16.
D) Comment line 20.
⧪ please give your answer in a comment section.
10. public static void main(String[ ] args) {
11. List
3 Comments
A
ReplyDeleteb
ReplyDeleteA
ReplyDelete