Skip to content

Instantly share code, notes, and snippets.

@ozcanzaferayan
Last active November 11, 2018 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozcanzaferayan/def79fa87ef2819e55b619b512b60583 to your computer and use it in GitHub Desktop.
Save ozcanzaferayan/def79fa87ef2819e55b619b512b60583 to your computer and use it in GitHub Desktop.
Kotlin Nedir 2: Data class eşitliği
// User data class'ının oluşturulması
data class User(var name: String, var age: Int)
fun main(args: Array<String>) {
// Aynı değerlere sahip iki User nesnesinin oluşturulması
val val1 = User("zafer", 42)
val val2 = User("zafer", 42)
if(val1 == val2)
print("eşittir")
else
print("eşit değildir")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment