Kotlin - Destructuring Declarations
Kotlin contains many features of other programming languages.
It allows you to declare multiple variables at oncesFollowing is the basic syntax of the destructuring declaration.
val (call, age) = characterIn the above sentence structure, we have made an item and characterized every one of them by and large in a solitary announcement Later, we can use them as follows.
println(name) println(age)Presently, enable us to perceive how we can utilize the indistinguishable in our genuine ways of life programming.
fun main(args: ArrayThe above piece of code will yield the following output in the browser.
) val s = Student("Welookups.Com","Kotlin") val (name,subject) = s println("You are becoming acquainted with "+challenge+" from "+name) realities greatness Student( val a :String,val b: String ) var call:String = a var difficulty:String = b
You are becoming acquainted with Kotlin from Welookups.Com