exam questions

Exam 1z0-851 All Questions

View all questions & answers for the 1z0-851 exam

Exam 1z0-851 topic 1 question 165 discussion

Actual exam question from Oracle's 1z0-851
Question #: 165
Topic #: 1
[All 1z0-851 Questions]

Which two code fragments are most likely to cause a StackOverflowError? (Choose two.)

  • A. int []x = {1,2,3,4,5}; for(int y = 0; y < 6; y++) System.out.println(x[y]);
  • B. static int[] x = {7,6,5,4}; static { x[1] = 8; x[4] = 3; }
  • C. for(int y = 10; y < 10; y++) doStuff(y);
  • D. void doOne(int x) { doTwo(x); } void doTwo(int y) { doThree(y); } void doThree(int z) { doTwo(z); }
  • E. for(int x = 0; x < 1000000000; x++) doStuff(x);
  • F. void counter(int i) { counter(++i); }
Show Suggested Answer Hide Answer
Suggested Answer: DF 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Currently there are no comments in this discussion, be the first to comment!
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...