C# AND KOTLIN CODING BASICS: FOR ABSOLUTE BEGINNERS by TAM SEL

C# AND KOTLIN CODING BASICS: FOR ABSOLUTE BEGINNERS by TAM SEL

Author:TAM SEL [SEL, TAM]
Language: eng
Format: mobi, azw3, epub, pdf
Published: 2021-07-28T16:00:00+00:00


Output:

My Name is: TAM SEL

If we try to adjust the value of an immutable variable, what happens?

We will get a compilation error if we try to adjust the value of an immutable variable, as seen in the following example.

fun main(args : Array < String >){

/**

* This is an immutable variable

* also called unchangeable variable

* or read-only variable.

*/

val myName = "TOMSEL"

myName= "TOM SEL"

println( "My Name is: " +myName)

}

Output:

Error :( 13 , 5 ) Kotlin : Val cannot be reassigned



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.