settext kotlin
val textView: TextView = findViewById(R.id.textView)
textView.text = "Hello, Kotlin!"
Explanation:
val textView: TextView
declares a variabletextView
of typeTextView
.findViewById(R.id.textView)
is a method used to find theTextView
with the specified IDR.id.textView
.textView.text = "Hello, Kotlin!"
sets the text of thetextView
to "Hello, Kotlin!".