Home » Java » What does the term mean –"ForkJoinPool is not a part of the public contract" in java-Exceptionshub

What does the term mean –"ForkJoinPool is not a part of the public contract" in java-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

while going thru this article:
https://4comprehension.com/parallel-collection-processing-1/
I saw the sentence — ForkJoinPool is not a part of the public contract — What does this mean exactly.
As per my understanding ForkJoinPool is a public class with public methods in it.so it is a part of the public contract. But the above article says that ForkJoinPool is not a part of the public contract. Please clarify

How to&Answers:

The word “public” which you seem to be focusing on is not really concerned with the public keyword from the Java language. In the context of the post you are referring to it means that Java streams internally depend on ForkJoin pool. However, it is an implementation detail and there is no guarantee that it will continue to be like that. In other words it is not part of the contract made between the language users (genral public like you) and language implementers.