Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (15 sloc) 482 Bytes
package scalaBasics.absoluteBasics
object ValuesVariablesTypes extends App {
val x = 42
println(x)
val myString: String = "James"
val myBoolean: Boolean = true
val myChar: Char = 'd'
val myInt: Int = 33
val myShort: Short = 326
val myLong: Long = 35263256234L // notice the L on the end - this tells the compiler its a Long
val myFloat: Float = 3.0f // again notice the f on the end
val myDouble: Double = 4.27
var myVariable: Int = 27
myVariable = 6
}
You can’t perform that action at this time.