Oracle
1Z0-851 · Question #41
1Z0-851 Question #41: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #41. The question stem and answer options stay visible for context.
Question
Which two code fragments are most likely to cause a StackOverflowError? (Choose two.)
Options
- Aint []x = {1,2,3,4,5}; for(int y = 0; y < 6; y++) System.out.println(x[y]);
- Bstatic int[] x = {7,6,5,4}; static { x[1] = 8; x[4] = 3; }
- Cfor(int y = 10; y < 10; y++) doStuff(y);
- Dvoid doOne(int x) { doTwo(x); } void doTwo(int y) { doThree(y); } void doThree(int z) { doTwo(z); }
- Efor(int x = 0; x < 1000000000; x++) doStuff(x);
- Fvoid counter(int i) { counter(++i); }
Unlock 1Z0-851 to see the answer
You've previewed enough free 1Z0-851 questions. Unlock 1Z0-851 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.