Java Spliterator estimateSize() MethodThe estimateSize() method of Java Interface Spliterator is used to get an estimate of the number of elements remaining to iterate or returns Long.MAX_VALUE if infinite, unknown, or too expensive to compute. SyntaxFollowing is the declaration of estimateSize() method- ParameterThis method does not accept any parameter. ReturnThe estimateSize() method returns the estimated size of elements or Long.MAX_VALUE if infinite, unknown, or too expensive to compute. ExceptionsNA Compatibility VersionJava 1.8 and above Example 1Output: Estimate size of ArrayList: 4 Elements of arraylist: 1 -2 3 -4 Example 2Output: Estimate size of List: 7 Example 3Output: Estimate size: 3 Name present in List: Rahul Rohit Surya Again Estimate size is: 0 Next TopicJava-spliterator-foreachremaining-method |
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