?
You pass an integer to a function expecting type Any. It works without issue. Why is a primitive integer able to work with a function that expects an object?
You pass an integer to a function expecting type Any. It works without issue. Why is a primitive integer able to work with a function that expects an object?
fun showHashCode(obj: Any){
println("${obj.hasCode()}")
}
fun main() {
showHashCode(1)
}
fun showHashCode(obj: Any){
println("${obj.hasCode()}")
}
fun main() {
showHashCode(1)
}
Join the Discussion
Login to post a comment or share your explanation.
Login