Last active
June 24, 2018 15:07
-
-
Save YugandharVadlamudi/eadb1358cdcb12d38a65311b0a2cea35 to your computer and use it in GitHub Desktop.
Val variable declaration in kotlin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main(args: Array<String>) { | |
val hello = "hello" | |
//value can not be reinitialized because it is like final variable in java | |
hello = "dlkjf" // it will produce an compile time error | |
println("$hello") | |
} | |
###output### | |
hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment