Last active
November 11, 2018 21:50
-
-
Save ozcanzaferayan/def79fa87ef2819e55b619b512b60583 to your computer and use it in GitHub Desktop.
Kotlin Nedir 2: Data class eşitliği
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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