Last active
November 11, 2018 22:08
-
-
Save ozcanzaferayan/3571cf8648cbc7856deac58166e24d26 to your computer and use it in GitHub Desktop.
Kotlin Nedir 2: 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
class User { | |
var name: String | |
var age: Int | |
constructor(name: String, age: Int){ | |
this.age = age | |
this.name = name | |
} | |
} | |
fun main(args: Array<String>) { | |
val val1 = User("zafer", 42) | |
val val2 = User("zafer", 42) | |
if (val1 == val2) | |
print("eşittir") | |
else | |
print("eşit değildir") // eşit değildir çıktısı verecektir. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment