8- Comparable Interface

5:38 2 Oradores 2 Capítulos 128 segmentos

Capítulos

  1. 0:03

    Earlier I briefly mentioned the comparable interface. We use this interface to compare two objects like two user objects. Now, what is the benefit of this? Well, a lot of sorting algorithms are based on comparing objects. So with these comp…

  2. 5:06

    We can print a message like user1 is smaller than user2. else if user 1 .compared to user 2 equals 0, then we can print user 1 equals user 2. Otherwise, we're going to print user 1 is greater than user 2. Let's run the program. So user 1 is…