nerdexam
Oracle

1Z0-809 · Question #268

1Z0-809 Question #268: Real Exam Question with Answer & Explanation

Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #268. The question stem and answer options stay visible for context.

Question

Given the code fragments: class ThreadRunner implements Runnable { public void run () { System.out.print ("Runnable"); } } class ThreadCaller implements Callable { public String call () throws Exception {return "Callable"; } } and ExecutorService es = Executors.newCachedThreadPool (); Runnable r1 = new ThreadRunner (); Callable c1 = new ThreadCaller (); // Line n1 es.shutdown(); Which code fragment can be inserted at line n1 to start r1 and c1 threads?

Options

  • AFuture<String> f1 = (Future<String>) es.submit (r1); es.execute (c1);
  • Bes.execute (r1); Future<String> f1 = es.execute(c1);
  • CFuture<String> f1 = (Future<String>) es.execute(r1); Future<String> f2 = (Future<String>) es.execute(c1);
  • Des.submit(r1); Future<String> f1 = es.submit (c1);

Unlock 1Z0-809 to see the answer

You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 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.

Full 1Z0-809 Practice