Java Spliterator forEachRemaining() MethodThe forEachRemaining() method of Java Interface Spliterator is used to performs the given action for each remaining element sequentially in the current thread until all elements have been processed or the action throws an exception. SyntaxFollowing is the declaration of forEachRemaining() method- Parameter
ReturnThe forEachRemaining() method does not return anything. It only performs the given action for each remaining element. ExceptionsNullPointerException- This method has thrown an exception if the specified action is null. Compatibility VersionJava 1.8 and above Example 1Output: Skype Next Element Present? true Remaining Name Present in the List: Facebook Instagram Twitter Example 2Output: Elements Exist in arraylist : 100 -200 300 -400 500 Example 3Output: Elements os Array- 1 2 3 4 Next TopicJava-spliterator-getcomparator-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