698 views
4 votes
Question: In the following code segment, assume that the ArrayList wordList has been initialized to contain the String values ["lychee", "passionfruit", "guava", "acai",

"papaya", "mango"].
int count = 0;
for (String word wordList) {
}
if (word.indexOf("a") >= 0) {
count++;
}
System.out.println(count);

What is printed as a result of executing the code segment?
(A) 5
(B) 6
(C) 7
(D) 8
(E) 9

User Recluze
by
7.9k points

1 Answer

3 votes

Answer:

a

Step-by-step explanation:

User UncleCheese
by
7.3k points