Java Spliterator getExactSizeIfKnown() MethodThe getExactSizeIfKnown() method of Java Interface Spliterator is used to get an estimateSize() of the SIZED spliterator, otherwise returns -1. SyntaxFollowing is the declaration of getExactSizeIfKnown() method- ParameterThis method does not accept any parameter. ReturnThe getExactSizeIfKnown() method returns the estimateSize() of the spliterator, if known, otherwise returns -1. ExceptionsNA Compatibility VersionJava 1.8 and above Example 1Output: Estimate size: 4 Exact size: 4 Elements of arraylist-- 1001 -2001 3001 -4001 Example 2Output: Exact size before getting List elements: 3 Rahul Nikki Prem Exact size after getting List elements: 0 |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India