• +91 9723535972
  • info@interviewmaterial.com

Kotlin Interview Questions and Answers

Question - What do you mean by destructuring in Kotlin?

Answer -

Destructuring is a convenient way of extracting multiple values from data stored in(possibly nested) objects and Arrays. It can be used in locations that receive data (such as the left-hand side of an assignment). Sometimes it is convenient to destructure an object into a number of variables, for example:

val (name, age) = developer
Now, we can use name and age independently like below:

println(name)
println(age)

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners