Java Spliterator trySplit() MethodThe trySplit() method of Java Interface Spliterator is used to split the invoking spliterator. If this spliterator can be partitioned, returns a reference to a new spliterator for the partition, otherwise, it returns null. SyntaxFollowing is the declaration of trySplit() method- ParameterThis method does not accept any parameter. ReturnThe trySplit() method returns a spliterator covering some portion of the elements or returns null if this spliterator cannot be split. ExceptionsNA Compatibility VersionJava 1.8 and above Example 1Output: MySQL Python --Traversing the other half of the spliterator--- Java Android Example 2Output: Elements of ArrayList: 101 201 301 401 501 Output from splitr2: 101 201 Output from splitr1: 301 401 501 Next TopicJava-bitset-flip-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