nerdexam
Oracle

1Z0-804 · Question #109

Which method would you supply to a class implementing the Callable interface?

The correct answer is C. call (). public interface Callable<V> A task that returns a result and may throw an exception. Implementors define a single method with noarguments called call. Interface Callable<V> Type Parameters: V - the result type of method call The Callable interface is similar to Runnable, in…

Concurrency

Question

Which method would you supply to a class implementing the Callable interface?

Options

  • Acallable ()
  • Bexecutable ()
  • Ccall ()
  • Drun ()
  • Estart ()

How the community answered

(25 responses)
  • A
    4% (1)
  • B
    16% (4)
  • C
    72% (18)
  • E
    8% (2)

Explanation

public interface Callable<V> A task that returns a result and may throw an exception. Implementors define a single method with noarguments called call. Interface Callable<V> Type Parameters: V - the result type of method call The Callable interface is similar to Runnable, in that both are designed for classes whose instances arepotentially executed by another thread. A Runnable, however, does not return a result and cannot throw achecked exception. The Executors class contains utility methods to convert from other common forms to Callable

Topics

#Callable#call method#interface implementation#concurrency

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice