Question | Click to View Answer |
What does the following code print? var t: Boolean = true
println(t)
|
|
What does the following code print? println(10 > 3)
|
|
What does the following code print? println(5 != 5)
|
|
What does the following code print? println(true && false)
|
|
What does the following code print? println(5 < 6 && 10 == 10)
|
|
What does the following code print? println(false || true)
|
|
What does the following code print? println("frank" || true)
|
This code throws an error. Certain languages consider treat strings as truthy of falsy in boolean contexts, but Scala doesn't have truthy or falsy values. |
What does the following code print? println(40.getClass)
|
|
What does the following code print? println(99.isInstanceOf[Int])
|
|
What does the following code print? var f = "4.44".toFloat
println(f.getClass)
|
|
What does the following code print? println(77.toString == "77")
|
|