Читать книгу Programming Kotlin Applications - Бретт Мак-Лахлин, Brett McLaughlin - Страница 61

Types Aren't Interchangeable (Part 1)

Оглавление

Most of these types are likely unsurprising. They're typical for most languages. What will surprise you a bit is how far Kotlin will go to ensure you don't get your types wrong. Remember, Kotlin is strongly typed, and the language takes that pretty seriously.

To see this in action, let's add some basic information to the Person class. Listing 2.3 shows a slightly modified version of this class with some more properties and types.

Programming Kotlin Applications

Подняться наверх