In this Assignment, I have created a class named Person and mixed it with Ordered trait. For performing comparison between two persons i have overrided the compare method of Ordered trait in Person class. In this way the overrided compare method will be called when we compare one person to another person.
Input: personOne = new Person("Prateek", 21) and personTwo = new Person("Prateek", 25) and if we check: personOne < personTwo Then Output: true