+ 1
Kotlin functions - how do I feature a variable in a function that is also used elsewhere in the programme?
For example, if I had two functions, and the same variable was needed in both, where would I initialise it, and how would I make sure both functions could access the variable?
4 odpowiedzi
+ 2
Ohh, take this as example
class PAS {
lateinit var to:Int
fun foobar(){
to = 7
}
fun toobat(){
to = 89
}
}
+ 1
Thank you so much guys.
+ 1
Ok