Skip to content

Instantly share code, notes, and snippets.

@yyYank
Created April 8, 2016 14:43
Show Gist options
  • Select an option

  • Save yyYank/93e27aca11283b6f34b535819d00fdab to your computer and use it in GitHub Desktop.

Select an option

Save yyYank/93e27aca11283b6f34b535819d00fdab to your computer and use it in GitHub Desktop.
open class A(open val hoge : String)
class B(override val hoge : String) : A(hoge)
fun main(args: Array<String>) {
val a = "a"
val b = "a"
val c = 3
val d = 3
val e = A("hoge")
val f = A("hoge")
val g = B("hoge")
println(a == b)
println(a === b)
println(c == d)
println(c === d)
println(e == f)
println(e === f)
println(e == e)
println(e === e)
println(f == g)
println(f===g)
}
@yyYank
Copy link
Author

yyYank commented Apr 8, 2016

true
true
true
true
false
false
true
true
false
false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment