Oracle
1Z0-803 · Question #132
1Z0-803 Question #132: Real Exam Question with Answer & Explanation
The correct answer is B: Total match found: 2. See the full explanation below for the reasoning.
Question
Given: public class App { public static void main(String[] args) { char[] arr = {'A', 'e', 'I', 'O', 'u'}; int count = 0; for (int i = 0; i < arr.length; i++) { switch (arr[i]) { case 'A': continue; case 'a': count++; break; case 'E': count++; break; case 'I': count++; continue; case 'O': count++; break; case 'U': count++; } } System.out.print("Total match found: " + count); } } What is the result?
Options
- ATotal match found: 1
- BTotal match found: 2
- CTotal match found: 3
- DTotal match found: 5
Community Discussion
No community discussion yet for this question.