Abstract
The traversal of data structures has been simplified through the use of consumers which can be used to replace the while loops associated with iterators. In Java 8, the default forEachRemaining method which accepts a consumer was added to the Iterator interface. The PrimitiveIterator interface can be used to traverse a Java array of certain primitive types. In Java 8, the default forEach method, which accepts a consumer, was added to the Iterable interface.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2019 Ralph Lecessi
About this chapter
Cite this chapter
Lecessi, R. (2019). Use in Traversing Objects. In: Functional Interfaces in Java. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4278-0_8
Download citation
DOI: https://doi.org/10.1007/978-1-4842-4278-0_8
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-4277-3
Online ISBN: 978-1-4842-4278-0
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)