Java Magazine, Nov/Dec 2017
ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2017 93 fix this C Lines 15 and 17 are correct but lines 14 and 16 cause compilation to fail D Line 17 is correct but lines 14 15 and 16 cause compilation to fail E Line 14 is correct but lines 15 16 and 17 cause compilation to fail Question 3 advanced Given that the following declaration has been properly initialized to refer to a List implementation that contains multiple String objects and that your intention is to remove from the list all strings that start with List String ls Which of the following are true Choose two A The items can properly be removed by using this code for String s ls if s startsWith ls remove s B The items can properly be removed by using this code ls forEach s if s startsWith ls remove s C The items can properly be removed by using this code ListIterator String lis ls listIterator while lis hasNext if lis next startsWith lis remove D The items can properly be removed by using this code int last ls size for int idx 0 idx last idx if ls get idx startsWith ls remove idx
You must have JavaScript enabled to view digital editions.