-4

What is the meaning of view: View in Kotlin for Android?

Paolo Forgia
  • 6,572
  • 8
  • 46
  • 58

1 Answers1

1

What you're seeing is the parameters to pass into the function : view:View. It says you pass in a parameter of type View and when you use it in the function you reference it by it's name view.

For example:

fun doubleNumber(num:Int) : Int{
   return num * num
}

In this function doubleNumber we pass in a parameter of type Int and call it num. You can see that within the function when we want to use that passed in parameter we use it's name num.

ecain
  • 1,282
  • 5
  • 23
  • 54
  • thankyou , but i knew this .... SOMEBODY EDITED MY QUESTION .. actually i want to ask that how a view can be a datatype ? number , string is a datatype but a view ? means – Karandeep Singh Jul 27 '17 at 15:29
  • It's a class called View. You should look it up in the documentation. – ecain Jul 27 '17 at 15:33