Given the code below, how can you write the line this.moveTo('LA') more concisely?kotlindata class Student (val name: String, var location: String) { fun moveTo (newLoc: String) { location = newLoc }}fun main() { Student ('Snow', 'Cologne').run { this.moveTo ('LA')}

🎲 Try a Random Question  |  Total Questions in Quiz: 83  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
Kotlin Quiz — practice the complete quiz, review flashcards, or try a random question.

Kotlin MCQs For LinkedIn Skill Assessments.


Given the code below, how can you write the line this.moveTo('LA') more concisely?<br>kotlin<br>data class Student (val name: String, var location: String) {<br> fun moveTo (newLoc: String) { location = newLoc }<br>}<br>fun main() {<br> Student ('Snow', 'Cologne').run {<br> this.moveTo ('LA')<br>}<br>