1z0-809 Exam QuestionsBrowse all questions from this exam

1z0-809 Exam - Question 113


Given the code fragments:

and

What is the result?

Show Answer
Correct Answer: C

The provided code creates an ExecutorService to run tasks concurrently. It defines two classes: R, which implements Runnable, and C, which implements Callable<String>. The code uses `es.execute(new R())` to run an instance of R, which prints 'Run...'. Next, it uses `es.submit(new C())` to run an instance of C, which returns 'Call...' and prints it out using `System.out.println(f1.get())`. Assuming exceptions are properly handled as implied in the code snippets, the output is 'Run... Call...'.

Discussion

7 comments
Sign in to comment
Svetleto13Option: C
May 27, 2021

If we add exceptions to main method answer is C.

Sofia_ShireenOption: B
Nov 25, 2021

Answer is B,tested

samtash1034Option: C
Jan 6, 2022

C,tested

steefaandOption: C
Feb 6, 2024

C is correct. Since code snippet is given assume that exceptions are properly handled.

steefaandOption: C
Feb 6, 2024

C is correct. Since code snippet is given assume that exceptions are properly handled.

asdfjhfgjuaDCVOption: C
Mar 7, 2024

C is the answer

DarGrinOption: D
May 30, 2024

We don't have informatione, if exception ist handeld or not. That's why is the answer D.