Oracle
1Z0-805 · Question #65
1Z0-805 Question #65: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-805 to reveal the answer and full explanation for question #65. The question stem and answer options stay visible for context.
Question
Given: class Fibonacci extends RecursiveTask<Integer> { final int n; Oracle 1Z0-805 Exam Fibonacci (int n) { this.n = n } Integer compute () { if (n <= 1) return n; Fibonacci f1 = new Fibonacci (n ?1); f1.fork; // Line X Fibonacci f2 = new Fibonacci (n ?2); // Line Y return f2.compute() + f1.join; } } Suppose that lines X and Y are transposed: Fibonacci f2 = new Fibonacci (n ?2); // Line Y f1.fork; // Line X 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 single-threaded.
- 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, the 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.