Abstract
Functional interfaces have changed the way data is compared in Java. This is due to the enhancements to the Comparator interface, and the addition of several methods that utilize it in the Java API. Comparator is a functional interface that is used to compare two objects. Its functional method, called compare, takes two arguments of type T and returns an integer. Chains of comparators can be built using the Comparator interface’s default thenComparing methods.
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 Comparing Objects. In: Functional Interfaces in Java. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4278-0_10
Download citation
DOI: https://doi.org/10.1007/978-1-4842-4278-0_10
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)