🪴 Nishanth Gobi

Search

SearchSearch
Home

>

Zettelkasten

>

Literature Notes

>

Data Classes in Kotlin

Data Classes in Kotlin

May 15, 2024, 1 min read

  • #zettel
  • #lit
  • #kotlin
  • Data classes have the same functionality as classes, but they come automatically with additional member functions
  • Some useful pre-defined member functions,
    • toString()
    • equals() or ==
    • copy()
data class User (
	val name: String,
	val id: Int
)

Refs §

  1. https://kotlinlang.org/docs/kotlin-tour-classes.html#data-classes

Graph View


Created with Quartz v4.1.0, © 2024

  • GitHub
  • LinkedIn