Write a class Employee (val name: String, val age: Int, val salary: Int) implementing the Comparable interface. Our developers use this class to sort the list of employees, and we know for sure that the best employee is at the bottom of the list.
Comparable and Comparator
Sort by salary
Report a typo
Write a program in Kotlin
data class Employee(val name: String, val age: Int, val salary: Int) {
// write your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.