Oracle
1Z0-805 · Question #14
1Z0-805 Question #14: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-805 to reveal the answer and full explanation for question #14. The question stem and answer options stay visible for context.
Question
Given: class Fibonacci extends RecursiveTask<Integer> { final int n; Fibonacci (int n) { this.n = n } Integer compute () { if (n <= 1) return n; Fibonacci f1 = new Fibonacci (n ?1); Oracle 1Z0-805 Exam f1.fork; Fibonacci f2 = new Fibonacci (n ?2); return f2.compute() + f1.join; // Line ** } } Assume that line ** is replaced with: return f1.join() + f2.compute(); // Line ** What is the likely result?
Options
- AThe program produces the correct result, with similar performance to the original.
- BThe program produces the correct result, with performance degraded to the equivalent of being
- CThe program produces an incorrect result.
- DThe program goes into an infinite loop.
- EAn exception is thrown at runtime.
- FThe program produces the correct result, with better performance than the original.
Unlock 1Z0-805 to see the answer
You've previewed enough free 1Z0-805 questions. Unlock 1Z0-805 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.