Skip to content

Deeeeksha/OOPS_Assignment-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OOPS_Assignment-2

Define a class named Person and mix it with Ordered Trait to do the comparison. First, check if the name parameter of both objects is equal. If yes, then do the comparison according to age. If name is not equal then do the comparison based on name length. class Person(val name: String, val age: Int) extends Ordered[Person]{ } For example: Input: personOne = new Person("Test", 24) and personTwo = new Person("Test", 25) personOne < personOne Output: true

Input: personOne = new Person("TestAgain", 24) and personTwo = new Person("Test", 25) personOne < personOne Output: false

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages