Oracle
1Z0-815 · Question #97
Which three are valid replacements for foo so that the program will compiled and run? public class ForTest { public static void main(String[] args) { int[] arrar = {1,2,3}; for ( foo ) { } } }
The correct answer is A. int i: array B. int i = 0; i < 1; i++ C. See the full explanation below for the reasoning.
Question
Which three are valid replacements for foo so that the program will compiled and run? public class ForTest { public static void main(String[] args) { int[] arrar = {1,2,3}; for ( foo ) { } } }
Options
- Aint i: array
- Bint i = 0; i < 1; i++
- C;;
- D; i < 1; i++
- E; i < 1;
How the community answered
(38 responses)- A76% (29)
- D18% (7)
- E5% (2)
Community Discussion
No community discussion yet for this question.