Skip to content

Instantly share code, notes, and snippets.

@ozcanzaferayan
Last active November 11, 2018 22:08
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/3571cf8648cbc7856deac58166e24d26 to your computer and use it in GitHub Desktop.
Save ozcanzaferayan/3571cf8648cbc7856deac58166e24d26 to your computer and use it in GitHub Desktop.
Kotlin Nedir 2: Class eşitliği
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