exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 114 discussion

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

Given the code fragment:



Which statement at line 1 will print Ping Pong?

  • A.
  • B.
  • C.
  • D.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
ASPushkin
1 week, 6 days ago
Selected Answer: C
answer : C theoretically it could return : Pong Ping B. not compiled method execute is void D. it will not compile the invokeAny method parameter has to be a type of Collection <T> T invokeAny(Collection<? extends Callable<T>> tasks)
upvoted 1 times
...
d7bb0b2
6 months ago
only C: D:cannot because invokeany return a Result of callables completely ok. Future<String> future = executor.invokeAny(List.of(new Callable<String>(){ public String call() throws Exception { return "PONG"; }; }));
upvoted 1 times
d7bb0b2
5 months ago
A: call method of callabe return a type String not a future and callabe cannot be asigned to future directry B: compile error BECAUSE Future<String> future = service.submit(()->"Pong"); is not a runnable C: Future<String> future = service.submit(()->"Pong"); => ok D: invoke any acept Collection of callable not a single callable
upvoted 1 times
...
...
TheOneAboveAll
8 months ago
Selected Answer: C
Tested C
upvoted 1 times
...
Omnisumem
8 months, 2 weeks ago
Selected Answer: C
Tested: C. To test it is enough to code it with "public static void main (String[] args) throws Exception {...".
upvoted 1 times
...
[Removed]
9 months, 2 weeks ago
Let's just assume it's surrounded by a try-catch catching both InterruptedException & ExecutionException. Then C is correct.
upvoted 1 times
...
Jtic
1 year, 3 months ago
Selected Answer: C
Future<String> future = es.submit(() -> "Pong");
upvoted 1 times
...
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago