Duration: 17 minutes
Summary: In this video, we will discuss an advanced functionality in the ArrayList. We discussed sorting in the previous video. But how about sorting array of books? Do we sort by name, title, ISBN, price…? In order for us to give the array a hint on how to sort books, we implement the Comparable and Comparator interfaces. We will see why we need one interface instead of the other. For that, we add a Book class to the example. We create an ArrayList of books, and sort them in two different ways depending on which sort algorithm we are using.