This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Employee { | |
def salary: Int | |
} | |
trait InOffice { | |
def desk: String | |
} | |
trait Remote { | |
def location: String | |
def timeZone: String | |
} | |
trait Temporary { | |
def startDate: Int | |
def stay: Int | |
def endDate(): Int = (startDate + stay) % 12 | |
} | |
trait Authority { | |
def directReports: Array[Employee] | |
def hasDirectReports() :Boolean = directReports.length != 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment