Created
May 6, 2022 06:11
-
-
Save AndroidPoet/0182cab89a207b24947333e8a1d88e02 to your computer and use it in GitHub Desktop.
Variables
This file contains 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() { | |
//var can be reassigned | |
var varInt: Int = 1 | |
var varString: String = "Hello" | |
var varDouble: Double = 24.0 | |
var varLong: Long = 30L | |
//val can't be reassigned | |
val valInt: Int = 1 | |
val valString: String = "Hello" | |
val valDouble: Double = 34.0 | |
val valLong: Long = 30L | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment