Questions tagged as 'data-class'

3
answers

In a data class can you have properties other than those generated automatically?

Kotlin allows you to simplify the creation of what we call POJO in Java: data class Person(val firstName: String, val lastName: String) We get a class with the getter for all variables declared in the constructor as well as the methods...
asked by 11.08.2017 / 20:00
1
answer

What is the purpose of the data class?

In Kotlin you can create a class as follows: data class Dragon(private val name: String, val glass: Int) What is the main goal of data class in Kotlin? When should we use?     
asked by 11.08.2017 / 19:37
1
answer

What is the difference between Kotlin data class and Scala case class?

In Scala we have case classes , for example: case class Pessoa(nome: String, sobrenome: String) and in Kotlin we have data classes : data class Pessoa( val nome: String, val sobrenome: String ) What's the difference between...
asked by 10.07.2016 / 13:36