ExamVeda
Login
Home
This question belongs to Computer Science Kotlin Program
Kotlin Program
?

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)
}

Answer & Solution
Correct Answer: Option D
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.