You found this program in the "mutability section" of the Bad Programming Guide:
object VariablesQuiz extends App {
var a = 0
var b = 1
a = a + 1; b = a + b;
var c = a + b
c = c * a * b
println(c)
}
What does this program print?
You found this program in the "mutability section" of the Bad Programming Guide:
object VariablesQuiz extends App {
var a = 0
var b = 1
a = a + 1; b = a + b;
var c = a + b
c = c * a * b
println(c)
}
What does this program print?
Create a free account to access the full topic