The code snippet below translates a database user to a model user. Because their names are both User, you must use their fully qualified names, which is cumbersome. You do not have access to either of the imported classes' source code. How can you shorten the type names?kotlinimport com.tekadept.app.model.Userimport com.tekadept.app.database.Userclass UserService{ fun translateUser(user: com.tekadept.app.database.User): User = com.tekadept.app.model.User('${user.first} ${user.last}')}

🎲 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.


The code snippet below translates a database user to a model user. Because their names are both User, you must use their fully qualified names, which is cumbersome. You do not have access to either of the imported classes' source code. How can you shorten the type names?<br>kotlin<br>import com.tekadept.app.model.User<br>import com.tekadept.app.database.User<br>class UserService{<br> fun translateUser(user: com.tekadept.app.database.User): User =<br> com.tekadept.app.model.User('${user.first} ${user.last}')<br>}<br>