-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Java 9 Concurrency Cookbook, Second Edition
By :

There are two kinds of exceptions in Java:
throws
clause of a method or caught inside them. For example, IOException
or ClassNotFoundException
.NumberFormatException
.You can't throw any checked exception in the compute()
method of the ForkJoinTask
class because this method doesn't include any throws
declaration in its implementation. You have to include the necessary code to handle the checked exceptions. On the other hand, you can throw (or it can be thrown by any method or object used inside the method) an unchecked exception. The behavior of the ForkJoinTask
and ForkJoinPool
classes is different from what you may expect. The program doesn't finish execution and you won't see any information about the exception in the console. It's simply swallowed as if it weren't thrown. Only when you call the get()
method...