Person("Pippo") val fifthCharOfSurname: Char? = p.surname?.charAt(4) //this is nullable type fifthCharOfSurname?.doSomething() //executed only if not null @_tiwiz
for the first time > object expressions are executed (and initialized) immediately, where they are used > a companion object is initialized when the corresponding class is loaded (resolved), matching the semantics of a Java static initializer @_tiwiz