ES("Hola"), FR(“Bonjour”), EN(“Hello”) } class User(val firstName: String, var lastName: String, var language: Language = Language.EN) fun main(args: Array<String>) { val user = User("João", "Andrade") val greeting = user.language.greeting println(greeting) } > Hello
var filtered = ArrayList<T>() for (item in items) if (predicate(item)) filtered.add(item) return filtered } val portugueseSpeaker = User("João", "Andrade", Language.PT) val frenchSpeak = User("Jean", "Andrade", Language.FR) val englishSpeaker = User("John", "Andrade", Language.EN) val speakers = listOf(portugueseSpeaker, frenchSpeak, englishSpeaker)