<Retrieving a Variable output from IF or ELSE cond...
# stackoverflow
u
Retrieving a Variable output from IF or ELSE condition in KOTLIN I am trying to retrieve the output value from else condition in Kotlin. I am not sure how to store the data outside If or Else condition. Any help is appreciated. else { var data=db.readData() for (i in 0..data.size - 1) { var data=db.readData() var output=data.get(i).name println("Result is $output") } } //Need to Get Output here var test=output??