WEB Button DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Kotlin - Destructuring Declarations


Kotlin contains many features of other programming languages.

It allows you to declare multiple variables at onces

Following is the basic syntax of the destructuring declaration.
 

val (call, age) = character 

In 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: Array) 

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 

The above piece of code will yield the following output in the browser.
You are becoming acquainted with Kotlin from Welookups.Com