I. Overview
The interface is located under the Java.util.concurrent package, declared: Publicinterfacecallable<v> V
- Call The result type of the method
A task that returns the result and may throw an exception. The implementing person defines a method called call without any parameters . The callable interface is similar in Runnable
that both are designed for classes whose instances might be executed by another thread. However, Runnable does not return a result and cannot throw a checked exception. Executors
class contains some practical methods for converting from other ordinary forms to callable classes.
Second, the method
Pager () throws Exception
-
Evaluates the result and throws an exception if the result cannot be evaluated.
-
-
Return:
-
The result of the calculation
-
Thrown:
-
Exception
-If the result cannot be calculated
The callable interface in Java