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…
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)- A4% (1)
- B16% (4)
- C72% (18)
- E8% (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
Community Discussion
No community discussion yet for this question.